Visual Leak Detector 2.2.3 Visual C++内存检测工具(转载)
来源:互联网 发布:淘宝店铺宝箱 编辑:程序博客网 时间:2024/05/21 07:46
转载于http://blog.csdn.net/akof1314/article/details/7549979,在此谢过。
Visual Leak Detector是一款免费的、健全的、开源的Visual C++内存泄露检测系统。相比Visual C++自带的内存检测机制,Visual Leak Detector可以显示导致内存泄露的完整内存分配调用堆栈。
主页地址:http://vld.codeplex.com/
旧版地址:http://www.codeproject.com/Articles/9815/Visual-Leak-Detector-Enhanced-Memory-Leak-Detectio
下载Visual Leak Detector,当前版本2.2.3,在Visual C++ IDE的"工具"→"选项"→"项目和解决方案"→"VC++ 目录","包含文件"增加VLD的"\include"路径,"库文件"增加VLD的"\lib\Win32"路径,另外动态库"\bin\Win32"路径在安装时已经添加到环境变量里面了,若是未添加,则需要手动拷贝"\bin\Win32"下的文件到工程Debug目录。下面记录下使用方法:
1.新建一个Win32控制台项目;
2.添加代码如下所示:
1
2
3
4
5
6
7
8
#include "stdafx.h"
#include "vld.h"
int _tmain(int argc, _TCHAR* argv[])
{
char *pBuf = new char[200];
return 0;
}
2
3
4
5
6
7
8
#include "vld.h"
int _tmain(int argc, _TCHAR* argv[])
{
char *pBuf = new char[200];
return 0;
}
3.在Debug模式下的“输出”窗口,将有如下信息:
报告列出了内存泄露是在第几块,所在的地址,泄露的字节,调用的堆栈,内存内容。双击调用堆栈可以跳转到所在行。
4.在Release模式下,不会链接Visual Leak Detector。
5.Visual Leak Detector有一些配置项,可以设置内存泄露报告的保存地(文件、调试器),拷贝"\Visual Leak Detector"路径下的vld.ini文件到工程的Debug目录下(在IDE运行的话,则需要拷贝到工程目录下),修改以下项:
ReportFile = .\memory_leak_report.txt
ReportTo = both
ReportTo = both
直接双击Debug目录下exe,结果如下图所示:
文件内容跟“输出”窗口的内容一样。Visual Leak Detector 2.2.3 Visual C++内存检测工具
- Visual Leak Detector 2.2.3 Visual C++内存检测工具(转载)
- C/C++ 内存泄漏检测工具 Visual Leak Detector(转载)
- C/C++ 内存检测工具Visual Leak Detector
- Visual Leak Detector 2.2.3 Visual C++内存检测工具
- Visual Leak Detector 2.2.3 Visual C++内存检测工具
- Visual Leak Detector 2.2.3 Visual C++内存检测工具
- Visual Leak Detector 2.2.3 Visual C++内存检测工具
- 【转】Visual Leak Detector 2.2.3 Visual C++内存检测工具
- Visual Leak Detector 2.2.3 Visual C++内存检测工具
- Visual Leak Detector 2.2.3 Visual C++内存检测工具
- C/C++ 内存泄漏检测工具 Visual Leak Detector
- 内存泄露检测工具 -- Visual Leak Detector
- 内存泄露检测工具 -- Visual Leak Detector (转)
- 内存泄漏检测工具--Visual Leak Detector (VLD)
- 内存泄露检测工具 Visual Leak Detector
- 内存泄漏检测工具Visual Leak Detector
- VC2012内存泄漏检测工具Visual Leak Detector
- 内存泄露检测工具Using Visual Leak Detector
- java基础入门-----hashset1
- 压力测试时,利用Java让CPU使用率达到100%
- 图形用户界面—基本概念
- 水池数目 nyist27
- 在Eclipse4.2 4.3 中安装最新版插件 WindowsBuilder swt
- Visual Leak Detector 2.2.3 Visual C++内存检测工具(转载)
- win7 spss 安装破解
- java基础入门-----hashset2
- C/C++ 内存泄漏检测工具 Visual Leak Detector(转载)
- Java中Swing开发体验,画面间数据传递。
- plsql常用函数
- 绘图类—Graphics
- 十年工程师生涯总结
- Manacher's ALGORITHM: O(n)时间求字符串的最长回文子串