文中利用虚拟机管理器,透明地记录应用程序对资源的申请、释放以及使用情况,提供了探测内存泄露的辅助信息.此机制首先不需要修改或重新编译源程序;其次,带来的性能损失很小.两者结合可以构建在线内存泄露探测和汇报机制.不仅如此,基于虚拟机环境的内存泄露探测还具备通用性,且不需要特殊的硬件支持.所有这些特性,是已有的解决方案所不能兼有的.实验结果表明:基于虚拟机环境的内存泄露探测机制具有实用性,性能损失也被控制在10%以内,能够运用在实际的生产环境中.
In this paper,virtualization technology is utilized to transparently record the allocation and release of memory resources applied by applications running on virtual machine(VM),and these records provide the auxiliary information to detect memory leaks hiding in the binary code.Firstly,this mechanism does not require source code modification or recompilation;secondly,the performance overhead is very small,which makes it possible to build online memory leak detection and reporting mechanisms,free application developers from designing test suite and improve the chances of finding more memory leaks.Besides,memory leak detection based on the virtual environment also provides versatility without needing special hardware supports:not only user-mode application can be detected,but the operating system kernel;and both Linux and Windows are supported.Existing research cannot bring all of these features together.The experimental results show that the memory leak detection mechanism has a limited performance overhead which is less than 10%,and the information produced by the mechanism can help programmer to track out the possible memory leaks efficiently.