Use UMDH to identify memory leak problem
We sometimes got memory leak problem, and we need to find the leaked memory, Here is a usful tool from MS, UMDH, it is included in WinDBG install package.
- It need the PDB files to analyse access the symbol table, then a human readable stack can be generated.
- You need to generated two set of current used memory, and compare the two to have a result.
- It compares the current used memory, so you can identify the still-in-use memory, That is the memory you stored somewhere, but they will actually never be used again, and should be released.
- And of cause, it can identify the memory with out a ptr pointing to when comparing.
You should let memory leak a little more to get a clear view of the result.
Here is the steps to use UMDH:
1. Install Windbg, you can get WinDBG from MS site:http://msdn.microsoft.com/en-us/windows/hardware/hh852365
2. Open a Dos Prompt as Administrator and navigate to the installation folder of WinDbg
3. Set Symbol Path as a System Variable
set _NT_SYMBOL_PATH= SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols; c:\xosymbol
4. Download PDB file and copy to the “C:\xosymbol” which is set part of above environment variable “_NT_SYMBOL_PATH”
5. Start collecting stack traces for user-mode allocations, run command:
gflags /i <Your_process_name.exe> +ust
6. Restart your process.
7. Keep it running, wait until it become steady..
8. Collect a baseline snapshot, run command:
umdh -pn:<Your_process_name.exe> -f:c:\1.log
9. Wait until the memory usage of your process exceeds 1GB or more.
10. Generate a new snapshot, run command:
umdh -pn:<Your_process_name.exe> -f:c:\2.log
11. Compare the two snapshots and get the final report from UMDH
umdh -d c:\1.log c:\2.log > c:\result12.log
12. In the result, we can see the stack where the leaked memory is allocated, You got a direct hint to resolve the leak problem.
if you need an example, please go to page https://www.hyzblog.com/use-umdh-identify-memory-leak-problem/
Use UMDH to identify memory leak problem的更多相关文章
- A Cross-Platform Memory Leak Detector
Memory leakage has been a permanent annoyance for C/C++ programmers. Under MSVC, one useful feature ...
- JavaScript :memory leak [转]
Memory leak patterns in JavaScript Handling circular references in JavaScript applications Abhijeet ...
- Memory leak patterns in JavaScript
Handling circular references in JavaScript applications Plugging memory leaks in JavaScript is easy ...
- 山东省第七届ACM省赛------Memory Leak
Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in ...
- Identify Memory Leaks in Visual CPP Applications —— VLD内存泄漏检测工具
原文地址:http://www.codeproject.com/Articles/1045847/Identify-Memory-Leaks-in-Visual-CPP-Applications 基于 ...
- A memory leak issue with WPF Command Binding
Background In our application, we have a screen which hosts several tabs. In each tab, it contains a ...
- Memory Leak Detection in C++
原文链接:http://www.linuxjournal.com/article/6556?page=0,0 An earlier article [“Memory Leak Detection in ...
- [Node.js] Identify memory leaks with nodejs-dashboard
In this lesson, I introduce a memory leak into our node.js application and show you how to identify ...
- malloc(50) 内存泄露 内存溢出 memory leak会最终会导致out of memory
https://en.wikipedia.org/wiki/Memory_leak In computer science, a memory leak is a type of resource l ...
随机推荐
- ubuntn安装
环境win7 64 ,在vmn中安装ubuntn,需要开启虚拟化操作步骤: 1.首先进入BIOS,我的是thinkphpE440,在开机联想界面出现的那刻按F1: 2.选择切换到security页面, ...
- Java 中父类怎么调用子类的方法?
父类能调用子类的方法吗? 答:能. 怎么做? ● 把子类传递到父类的有参构造中,然后调用. ● 使用反射的方式调用,你使用了反射还有谁不能调用的?! ● 父类调用子类的静态方法. 案例展示: pack ...
- iOS如何解析crash文件中的地址
1.目录中存放app文件 2.打开文件 3.执行命令otool -arch arm64 -l ./QQStock | grep -B 1 -A 10 "LC_SEGM" | gr ...
- 更新oracle数据库表如何实现主键自增长
在数据库中实现主键自动增长有利于我们做数据插入操作,在SQL SERVER上创建表时可以在int类型的字段后加上identity(1,1),该字段就会从1开始,按照+1的方式自增,将这个字段设置 ...
- windows 删除删除不掉的文件
DEL /F /A /Q \\?\%1RD /S /Q \\?\%1 windows下删除删除不掉的文件: 1.打开记事本,把上面的命令复制进去 2.保存,后缀名改为.bat,ok 3.把想要删除的文 ...
- 带你从零学ReactNative开发跨平台App开发(十一)
ReactNative跨平台开发系列教程: 带你从零学ReactNative开发跨平台App开发(一) 带你从零学ReactNative开发跨平台App开发(二) 带你从零学ReactNative开发 ...
- 【转】grep -v grep
1.grep 是查找含有指定文本行的意思,比如grep test 就是查找含有test的文本的行 2.grep -v 是反向查找的意思,比如 grep -v grep 就是查找不含有 grep 字段的 ...
- Oracle EBS AP 已经完全付款的发票仍然可以选择并进行零金额的付款
1>找出相应的发票; SELECT DISTINCT ai.invoice_id, ai.invoice_num invoice_num, pv.segment1 vendor_num, pv. ...
- Sql语法高级应用之三:存储过程
一.存储过程概述 SQL Server中的存储过程是使用T_SQL编写的代码段.它的目的在于能够方便的从系统表中查询信息,或者完成与更新数据库表相关的管理任务和其他的系统管理任务.T_SQL语句是SQ ...
- SQLServer SELECT @@IDENTITY 遇到的坑
经常在写存储过程的时候获取当前插入后的ID都会用 @@IDENTITY 但是今天在用 @@IDENTITY的时候涉及到当前数据的插入会有insert触发器发生时,发现与实际插入的ID值对不上,网上查 ...