内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
来源:互联网 发布:盐城数据产业园能去吗 编辑:程序博客网 时间:2024/04/28 16:19
转自:http://blog.csdn.net/ysysbaobei/article/details/8082508
工程目录路径不能包含中文名、Microsoft.DTfW.DHL.manifest必须要
http://blog.csdn.net/xinyaping/article/details/6751940
http://blog.csdn.net/hunter8777/article/details/6330531
Visual Leak Detector是一款免费的检查内存泄露的工具。最新的2.2.3版本可以很好的支持VS2008/2010。
点击 http://visualstudiogallery.msdn.microsoft.com/7c40a5d8-dd35-4019-a2af-cb1403f5939c
http://vld.codeplex.com/releases/view/82311这里下载
安装后,
1、在VS中设置Tool->Options 选择Projects and Solutions中的VC++ Directories ->在Include Files和Library Files下(右上角:显示以下内容的目录下),将Visual Leak Detector安装路径中的include(C:\Program Files\Visual Leak Detector\include)和lib(C:\Program Files\Visual Leak Detector\lib\Win32)路径分别添加进去;
2、将安装路径(C:\Program Files\Visual Leak Detector\bin\Win32)下bin里的相应dll(vld_x86.dll、dbghelp.dll、Microsoft.DTfW.DHL.manifest)拷贝至debug目录下。
创建一个简单的工程,其中指针b所指向的内存没有被正确地释放。
- void leak()
- {
- int *b = new int[10];
- for (int i = 0; i < 10; ++i)
- {
- b[i] = i;
- }
- }
- int main()
- {
- leak();
- return 0;
- }
#include <vld.h>,运行就能在output窗口看到效果啦,放在stdafx.h后,其他之前
输出的部分主要分为两块
Call Stack部分:
是泄露内存的调用堆栈,其中显示了泄露资源创建的位置,双击便可以定位到相应的代码部分。
Data部分:
即使泄露部分的内存内容。
------程序关闭,在输出中看到内存有无泄漏信息
- 内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- (搬运工)内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- 内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- 内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- 内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- 内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- 内存泄露检测工具 -- Visual Leak Detector
- 内存泄露检测工具 -- Visual Leak Detector (转)
- 内存泄露检测工具 Visual Leak Detector
- 内存泄露检测工具Using Visual Leak Detector
- vld(Visual Leak Detector 内存泄露检测工具
- vld(Visual Leak Detector) 内存泄露检测工具
- C/C++ 内存检测工具Visual Leak Detector
- vc6.0内存泄露之检测工具Visual Leak Detector
- C++内存泄露检测工具Visual Leak Detector的使用
- 使用Visual Leak Detector for Visual C++ 捕捉内存泄露
- 使用Visual Leak Detector for Visual C++ 捕捉内存泄露
- 使用Visual Leak Detector for Visual C++ 捕捉内存泄露
- C++面试题-String函数实现
- VC下调试方式简单整理
- ListView的应用
- 免提
- android mediarecord 实现暂停断点录音功能
- 内存泄露检测工具 Visual Leak Detector for Visual C++ 2008/2010
- GCD
- 关于学习oracle的PLSQL的完整笔记
- 看大神文章小结——微软等面试 23,24,25,26
- 深入分析Cocos2d-x 2.0中的“纹理”
- Android项目常用的几种对话框
- android开源框架
- 让XCode的 Stack Trace信息可读
- php页面上错误显示