umdh工具使用

先安装工具,http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

选择其中的http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

下载安装后,使用umdh工具

运行cmd窗口,将路径设置到安装路径

D:Program FilesDebugging Tools for Windows (x86)>set _NT_SYMBOL_PATH="%windir%symbols";D:AppPath;               // 这里设置环境变亮

D:Program FilesDebugging Tools for Windows (x86)>gflags -i appname.exe +ust                 //设置标签flags

启动appname.exe

D:Program FilesDebugging Tools for Windows (x86)>umdh.exe -pn:appname.exe -f:FirstDump.txt       //保存当前状态

运行appname.exe中相关的各项工作任务

D:Program FilesDebugging Tools for Windows (x86)>umdh.exe -pn:appname.exe -f:SecondDump.txt       //保存当前状态

D:Program FilesDebugging Tools for Windows (x86)>umdh.exe FirstDump.txt SecondDump.txt -f:Result.txt           //使用umdb比较dump文件

最后打开result.txt可以看到里面显示了哪里出现了内存泄露

原文地址:https://www.cnblogs.com/james1207/p/3324872.html