检查是否有内存遗漏的简单方法
i = system( "wmic os get FreePhysicalMemory /value" )
该命令显示当前可用物理内存。
Linux下可以用valgrind去特定内存遗漏
valgrind --error-limit=no --leak-check=full --show-reachable=no myprog arg1 arg2 2>&1 | tee valgrind.log
详细可参见http://valgrind.org/docs/manual/mc-manual.html
Windows下可用DrMemory : http://www.drmemory.org/
其他
Wine and Valgrind http://wiki.winehq.org/Wine_and_Valgrind
Visual Leak Detector for Visual C http://vld.codeplex.com/
Very sleepy http://www.codersnotes.com/sleepy
VMMap http://technet.microsoft.com/en-us/sysinternals/dd535533
D.U.M.A. http://duma.sourceforge.net/