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 ...
随机推荐
- 基于token的后台身份验证(转载)
几种常用的认证机制 HTTP Basic Auth HTTP Basic Auth简单点说明就是每次请求API时都提供用户的username和password,简言之,Basic Auth是配合RES ...
- scss-!optional
optional翻译成汉语具有"可选的"的意思.顾名思义,!optional标记前面的扩展不必须生成一个新的选择器.看一段SCSS代码片段: p{ color:red; @exte ...
- html基础-from表单(5)
一.form表单 表单提交: <form action="提交地址"method="提交方法"></form> methad有两种提交方 ...
- java 方法重写和属性重写
重写,子类对父类方法不满意,重写,但这是重写,要与父类的方法一模一样.方法名相同:参数列表相同:返回值相同或子类的返回值是父类返回值的子类型,父类是long,子类是int也不可以,因为父类引用指向子类 ...
- JQuery 引用方式
# head里面 <script src="jquery.min.js"></script> <script src="common.js& ...
- Oracle EBS 请求添加SQL语句
- Oracle AP更新供应商
/*l_return_status:S l_msg_count:0 l_msg_data: l_vendor_id:133003 l_party_id:236055 */ DECLARE l_ ...
- 4 个用于构建优秀的命令行用户界面的 Python 库
作者: Amjith Ramanujam 译者: LCTT Lv Feng 在这个分为两篇的关于具有绝佳命令行界面的终端程序的系列文章的第二篇教程中,我们将讨论 Prompt.Toolkit.Clic ...
- Mysql--通俗易懂的左连接、右连接、内连接
刚开始看书的时候花了好长时间理解 先通俗易懂的描述下: left join(左联接): 返回包括左表中的所有记录和右表中联结字段相等的记录. right join(右联接): 返回包括右表中的所有记录 ...
- oracle监听,数据库,oracle服务器的启动和停用
一.oracle监听,数据库,oracle服务器的启动和停用 使用root用户登录:切换用户su – root/root操作系统,一般只有root用户才有权限去操作系统中安装的oracle数据库服务器 ...