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.


And
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的更多相关文章

  1. A Cross-Platform Memory Leak Detector

    Memory leakage has been a permanent annoyance for C/C++ programmers. Under MSVC, one useful feature ...

  2. JavaScript :memory leak [转]

    Memory leak patterns in JavaScript Handling circular references in JavaScript applications Abhijeet ...

  3. Memory leak patterns in JavaScript

    Handling circular references in JavaScript applications Plugging memory leaks in JavaScript is easy ...

  4. 山东省第七届ACM省赛------Memory Leak

    Memory Leak Time Limit: 2000MS Memory limit: 131072K 题目描述 Memory Leak is a well-known kind of bug in ...

  5. Identify Memory Leaks in Visual CPP Applications —— VLD内存泄漏检测工具

    原文地址:http://www.codeproject.com/Articles/1045847/Identify-Memory-Leaks-in-Visual-CPP-Applications 基于 ...

  6. 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 ...

  7. Memory Leak Detection in C++

    原文链接:http://www.linuxjournal.com/article/6556?page=0,0 An earlier article [“Memory Leak Detection in ...

  8. [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 ...

  9. 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 ...

随机推荐

  1. css对ie的兼容性问题处理(一):

    1.在制作sidebar时对li里面的元素进行浮动,li在ie6/7下会出现4px的间间隙: 解决方法:在li下加上vertical-align属性,值可为top.bottom.middle: 扩展: ...

  2. 六位数随机验证 sms_code.py

    #!/usr/bin/python env # coding:utf-8 import random def code(num=6): res = "" for i in rang ...

  3. iOS设计模式 - 中介者

    iOS设计模式 - 中介者 原理图 说明 用一个中介对象来封装一系列的对象交互.中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互. 注:中介者对象本身没有复用价值 ...

  4. NSMapTable、NSHashTable与NSPointerArray的封装

    NSMapTable.NSHashTable与NSPointerArray的封装 说明 NSMapTable对应NSDictionary:NSHashTable对应NSSet:NSPointerArr ...

  5. Session管理

    request.session.set_expiry(10) #设置10s后session失效request.session.get_expire_at_browser_close() #查看sess ...

  6. UNIX高级环境编程(5)Files And Directories - 文件相关时间,目录文件相关操作

     1 File Times 每个文件会维护三个时间字段,每个字段代表的时间都不同.如下表所示: 字段说明: st_mtim(the modification time)记录了文件内容最后一次被修改的时 ...

  7. Ubuntu Linux 14.04 LTS 上安装php7+mysql+nginx

    输入 $ sudo apt-get install -y language-pack-en-base$ sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:o ...

  8. springsource-tool-suite插件的在线安装

      1 首先,确定你现在使用的eclipse属于哪个版本? 查看自己的eclipse平台的版本(我的eclipse平台版本是4.3)       2 根据eclipse版本,选择插件的版本 官网:ht ...

  9. Data Compression

    数据压缩 introduction 压缩数据可以节省存储数据需要的空间和传输数据需要的时间,虽然摩尔定律说集成芯片上的晶体管每 18-24 个月翻一倍,帕金森定律说数据会自己拓展来填满可用空间,但数据 ...

  10. JS 事件冒泡、捕获。学习记录

    作为一个转行刚到公司的新人,任务不多,这一周任务全部消灭,闲暇的一天也别闲着,悄悄的看起了书.今天写一下JS的事件冒泡.捕获. 也是今天看的内容有点多了,有些消化不了,就随手记录一下.纯属自我理解,如 ...