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. substr与substring的区别

    在js中字符截取函数有常用的三个slice().substring().substr()了,下面我来给大家介绍slice().substring().substr()函数在字符截取时的一些用法与区别吧 ...

  2. egg.js-基于koa2的node.js入门

    一.Egg.JS 简介 Egg.JS是阿里开发的一套node.JS的框架,主要以下几个特点: Egg 的插件机制有很高的可扩展性,一个插件只做一件事,Egg 通过框架聚合这些插件,并根据自己的业务场景 ...

  3. opencv3.2.0图像对比度与亮度调整

    ##名称:图像对象度与对比度调整(由轨迹条分别控制对比度和亮度值) ##平台:QT5.7.1+opencv3.2.0 ##时间:2017年12月13日 /***********建立QT控制台程序*** ...

  4. Spring Boot—19Cache

    pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...

  5. Spring Boot—14JdbcTemplate

    pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...

  6. CentOS7系列--5.2CentOS7中配置和管理Docker

    CentOS7配置和管理Docker Docker是操作系统级别的虚拟化工具,它能自动化布署在容器中的应用 1. 安装Docker 1.1. 安装Docker相关软件 [root@server1 ~] ...

  7. OpenGL学习--开发环境

    1. VS2017 Professional安装 1.1. 下载 mu_visual_studio_professional_2017_x86_x64_10049787.exe 1.2. 双击开始安装 ...

  8. use ROW_NUMBER() for pagination in Oracle and SQLServer

    ------------------------------------------------------------------------Oracle---------------------- ...

  9. Django 添加自定义包路径

    在设置文件里: import sys sys.path.insert(0,os.path.join(BASE_DIR,"要导包的目录名")) 用pycharm时,如果导包后没有自动 ...

  10. Python学习---IO的异步[asyncio模块(no-http)]

    Asyncio进行异步IO请求操作: 1. @asyncio.coroutine  装饰任务函数 2. 函数内配合yield from 和装饰器@asyncio.coroutine 配合使用[固定格式 ...