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

     

     

     

  • 相关阅读:
    sourceTree和eclipse 的使用
    oracle习题练习
    oracle详解
    单例模式
    反射详解
    Oracle 存储过程判断语句正确写法和时间查询方法
    MVC4 Jqgrid设计与实现
    遇到不支持的 Oracle 数据类型 USERDEFINED
    ArcGIS Server10.1 动态图层服务
    VS2010连接Oracle配置
  • 原文地址:https://www.cnblogs.com/sliencer/p/2706804.html
Copyright © 2020-2023  润新知