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. maven windows环境nexus3.0私服搭建

    下载 nexus3.x.x 需要JDK1.8版本到sonatype官网下载开源免费的OSS版本,OSS即为Open Source Software.下载地址:https://www.sonatype. ...

  2. cmake 基本命令

    1 # CMake 最低版本号要求cmake_minimum_required (VERSION 2.8) 2 项目信息project (Demo2) 3 aux_source_directory 查 ...

  3. CentOS6.4 下安装 MySql5.5.13

    1.卸载系统自带的MySql 1.1.查看该操作系统上是否已经安装了mysql数据库 [root@xhTest-1 ~]# rpm -qa | grep mysql 1.2.删除原mysql数据库 1 ...

  4. 在 Azure 中备份 Linux 虚拟机

    可以通过定期创建备份来保护数据. Azure 备份可创建恢复点,这些恢复点存储在异地冗余的恢复保管库中. 从恢复点还原时,可以还原整个 VM,或只是还原特定的文件. 本文介绍如何将单个文件还原到运行 ...

  5. [WinCE] Win CE 屏幕截图

    VS2005自带了这个工具,这个工具的名称为:“远程放大”,其路径为:"C:\Program Files\CE Remote Tools\5.01\bin\cczoom.exe" ...

  6. 使用eclipse遇到的unable to install breakpoint的问题

    调试一个tomcat工程,设置好断点,启动工程,结果出现了下面的错误: 继续运行,再进入断点之前,还会再度提示,但是最终会命中断点. 使用CGLIB查找关键字,了解到CGLIB是一个AOP的拦截库,想 ...

  7. C# DataGridview用NPOI导出Excel文件

    导出excel我用的是nuget 的NPOI,直接在项目中添加的,引用到项目中,下面是截图: 下面我把ExcelHelper贴出来 public static class ExcelHelper { ...

  8. Mysql压缩解决方案

    提到mysql压缩相关的内容,我们能想到的可能是如下几种和压缩相关的场景: 1.客户端和服务器之间传输的数据量太大,需要进行压缩,节约带宽 2.mysql某个列的数据量大,只针对某个列的数据压缩 3. ...

  9. FileTable的创建和使用

    1. 首先要在实例级别启用FILESTREAM,打开Sql Server Configuration Manager窗口,双击需要设置的SQL SERVER实例进行设置. 2. 需要更改 SQL SE ...

  10. [翻译] snapshotViewAfterScreenUpdates

    snapshotViewAfterScreenUpdates This method very efficiently captures the current rendered appearance ...