1, check handle leak.
Use Lua script to search the codes.
2, check memory leak.
If you use CRT, you could use:
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
//_CrtSetBreakAlloc(182366);
// http://msdn.microsoft.com/en-US/library/e5ewb1h3(VS.80).aspx
3, get performance data.
We could use PDH functions. CPDHData
4, 注释代码隔离问题。
5,
1. 加一个对象计数器, 哪种对象一直增加, 就是它了.
2. 申请比较多的类, 轮流内部增加一个 char buffer[65536], 看看内存增加是否加快, 很快就可以找出了.
6, VLD boundchecker ADPlus WinDbg SysInternals-Tools (handle)
7, OANOCACHE=1
http://msdn.microsoft.com/en-us/library/ms221105.aspx
For
example, if the application allocates a BSTR and frees it, the free
block of memory is put into the BSTR cache by Automation. If the
application then allocates another BSTR, it can get the free block from
the cache. If the second BSTR allocation is not freed, IMallocSpy
will attribute the leak to the first allocation of the BSTR. You can
determine the correct source of the leak (the second allocation) by
disabling the BSTR caching using the debug version of Oleaut32.dll, and
by setting the environment variable OANOCACHE=1 before running the
application.
8, some tools Mozilla uses:
http://www.mozilla.org/performance/tools.html
9, 启用或禁用内存诊断可以调用全局函数 AfxEnableMemoryTracking()
#ifdef _DEBUG
CMemoryState oldMemState, newMemState, diffMemState;
oldMemState.Checkpoint();
#endif
...
(被测试的代码)
...
#ifdef _DEBUG
newMemState.Checkpoint();
if(diffMemState.Difference(oldMemState, newMemState)) {
TRACE(“Memory Leaked Here:\n\n" );
}
#endif
相关推荐
本文中描述了C++中常见的内存泄露,以及对应的解决方法,并且介绍了几种常见的内存泄露检查工具的使用(常见的工具只有vld和codesnitch)
memory leak 教程,一步一步解决内存泄漏。
检测内存泄漏的工具源码 三个文件 使用时只要include一个头文件就可以 内含一个example程序
A Practical FlowSensitive and ContextSensitive C and C++ Memory Leak Detector
This program is a tool that help you positioning memory leak locations of an QUALCOMM BREW application on simulator. It can give the call stack of memory leaks (including the locations that MALLOC/...
C++ memory leak detection and exception
一个在模拟器上定位BREW应用程序内存泄露位置的工具,可以给出内存泄露位置的调用栈信息(包括MALLOC、REALLOC分配的内存,也能定位到调用ISHELL_CreateInstance的位置)
memory leak tools for android memory leak tools for android
Memory leak detection for WinCE
内存泄露(memory leak)资料,网上收集的,感谢原作者
This program is a tool that help you positioning memory leak locations of an QUALCOMM BREW application on simulator. It can give the call stack of memory leaks (including the locations that MALLOC/...
node-memory-leak-tutorial, 在节点中,调试内存泄漏的教程 调试 node.js 中的内存泄漏这是在 node.js. 中调试内存泄漏的快速教程步骤 1: 安装调试工具首先,你需要安装 v8-profiler 模块。 如果不需要在应用程序中...
使用__wrap_malloc查找malloc导致内存泄漏问题 memory leak 内存泄漏
This document is about Memory leak.
有关flex 内存泄漏memory leak介绍的ppt. flash player的内存泄漏实在搞的我头大了
技術分享_Glassfish 3.1.2.2 Web Service Memory Leak Workaround1
它被广泛用于ByteDance的主要应用程序的本机内存泄漏管理中,其好处是巨大的!使用MemoryLeakDetector的应用开始吧步骤1:将JitPack存储库添加到您的构建文件allprojects { repositories { maven { url ' ...
好用的javascript内存溢出检测工具
Converting a bitmap to a region - memory leak fix将位图转化为一个区域 - 修补了内存漏洞(179KB)