zoukankan      html  css  js  c++  java
  • Memo: How to use UMDH to detect memory leak

    1.       Download windows debug tools from MS

    2.       Based on the app type (x86 or x64), add path : C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86(or x64)

    3.       For all the dlls and exes I wanna detect: run

    a.       Gflags –i <dll name or exe name> +ust

    4.       Find you *.pdb, make sure it exist in _NT_SYMBOL_PATH

    5.       Start the app

    6.       UMDH –pn:<app name> -f:file1.log

    7.       do something in app, make sure the leak happens

    8.       UMDH –pn:<app name> -f file2.log

    9.       Compare the two files:

    a.       UMDH –d file1.log file2.log –f:result.log

    10.   Use notepad to check the result.log

    a.       Check the items in result.log, item like

    + 21560112 ( 33410790 - 11850678)    905 allocs            BackTrace14DA8214

    +     584 (    905 -    321)            BackTrace14DA8214        allocations

     

            ntdll!RtlUlonglongByteSwap+B52

            MSVCR100D!malloc_base+E3

            MSVCR100D!malloc_dbg+31C

            MSVCR100D!malloc_dbg+BF

            MSVCR100D!malloc_dbg+544

            MSVCR100D!calloc_dbg+2C

            MSVCR100D!calloc+19

    Means there are about 21MB memory potential memory leak found(this call stack happened in 584 times). I call it potential because I must check code to make sure whether this is a correct behavior or a memory leak.

     

     

     

  • 相关阅读:
    JVM基础(一)—— 运行时内存结构
    SQL if 和 case when查询示例
    SQL分组聚合查询
    My music
    DataX增量同步到ADB ADS时报错
    shell find的用法
    pycharm安装
    在两个库中查找出差异明细
    docker下安装centos
    升级RDS8.0遇到的问题
  • 原文地址:https://www.cnblogs.com/sliencer/p/2706804.html
Copyright © 2011-2022 走看看