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 ...
随机推荐
- Android Studio cannot resolve symbols
引入了第三方类库,不管怎么编译 clean 都找多到类库 关闭重新打开android studio就好了.....
- is_palindrome 回文递归
# coding=utf-8def is_palindrome(n,start,end): if start>end: return 1 else: return is_palindrome(n ...
- maven 安装与配置最佳实践
配置Maven环境变量 1.新建 maven home 环境变量 变量名:M2_HOME 变量值:D:\ProgramFiles\apache-maven-3.5.4 2 ...
- oracle 和 mysql 和区别
1.mysql 有枚举类型,oracle 没有; mysql不支持number.varchar2类型,报错.2.oracle 支持全外连接,mysql 不支持 select e.ename, e.sa ...
- PSP软件开发过程
1. 引言 这是为了编写psp系统的软件需求分析,主要按照提供的相关需求和功能. 1.1 项目风险 风险承担者包括: 任务提出者:承担任务不能完全按照想象的做出,投入等: 软件开发者:可能不能按时交付 ...
- leetCode题解 Student Attendance Record I
1.题目描述 You are given a string representing an attendance record for a student. The record only conta ...
- [VS2008] [.NET 3.5] 如何解决 The imported project "C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.CSharp.targets" was not found
重新安装或者修复 NETCFv35PowerToys https://download.microsoft.com/download/f/a/c/fac1342d-044d-4d88-ae97-d27 ...
- sql建JOB语句
declare job_id pls_integer; begin sys.dbms_job.submit(job => job_id, what => 'proc_AGTAWBSTATI ...
- linux soft
1.gdebi:可以使用gdebi来安装deb包,默认的deb安装使用的dpkg,dpkg 安装的缺点就是不解决包依赖关系 sudo apt-get install gdebi 当然也可以通过命令,使 ...
- MongoDB的Spring-data-mongodb集成(Win10 x64) 第一章 - MongoDB安装与简单命令
这是MongoDB系列的第一章,作者将持续更新. 1.下载 https://www.mongodb.com/download-center#community 2.安装与配置 有关安装的任何困难请点击 ...