Windows下UMDH内存泄漏检测工具使用方法

  • 双击安装"WinDbg_X86_v10.0.18362.1.msi",本机模块目录在:D:\Windows Kits\10\Debuggers,若找不到,则到看"开始菜单\Windows Kits"里有没有"WinDbg",若有则通过右击查看它的安装目录。
  • 进入WinDbg安装目录,例如:D:\Windows Kits\10\Debuggers\x86,打开CMD窗口。
    开始检测,执行命令:gflags.exe /i "MyApplication.exe" +ust
    成功输出:
Current Registry Settings for MyApplication.exe executable are: 00001000
    ust - Create user mode stack trace database

停止检测,执行命令:gflags.exe /i "MyApplication.exe" -ust

  • 设置程序符号路径(程序PDB不设置,分析出的堆栈没有行号,路径尽量不要带空格和引号)
    set _NT_SYMBOL_PATH=E:\workspace\MyApplication\Debug
  • 利用UMDH创建Heap快照
    执行命令:umdh.exe -pn:"MyApplication.exe" -f:"E:\snap1.log"
    程序执行一段时间后或程序占用内存增加时,修改"snap1.log"为"snap2.log",再次创建Heap快照。
  • 分析对比快照
    执行命令:umdh.exe -d "E:\snap1.log" "E:\snap2.log" -f:"E:\result_1-2.txt"
    umdh.exe -d "E:\snap1.log" "E:\snap2.log" > "E:\result_1-2.txt"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值