Identify Memory Leaks in Visual CPP Applications —— VLD内存泄漏检测工具
原文地址:http://www.codeproject.com/Articles/1045847/Identify-Memory-Leaks-in-Visual-CPP-Applications
基于CPOL License
Visual Leak Detector (VLD) is an easy to use memory leak detection system. The installation package can be downloaded from here.
After installation, it can be used with any C/C++ project simply by adding the following line to the code:
#include <vld.h>
When the program is executed under the Visual Studio debugger, Visual Leak Detector will output a memory leak report of the executed segment of the code, at the end of the debugging session. If memory leaks are detected, this report will point to the exact locations in the code segment, which allocated the leaked memory block.
The header file can be easily isolated from the rest of the source codes by guarding it with the pre-processor directive block. It can be made further user friendly by defining a separate Visual Studio build configuration for VLD. The steps are as follows:
- Include VLD header files(s) protected by a pre-processor directive.
Hide Copy Code
#ifdef _VLD_DEBUG
#include <vld.h> //For memory leak detection.
#endif //_VLD_DEBUG - Create a VLD specific Build Configuration for development purposes. Detailed steps to create a Build Configuration are available here.
- Under the new Build Configuration (example
VLD_Debug), define the pre-processor directive which enables VLD specific headers.- Right click on the project on Visual Studio Solution Explorer & select Properties. This will open the Property Page of the project.
- Expand the Configuration Properties node.
- Expand C\C++ node.
- Select Preprocessor. Enter preprocessor definition (example. "
_VLD_DEBUG"). - Add the location of the vld.h header file to "includes" directory path of this configuration.
- Select VLD specific Build Configuration for development purposes.
References
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
Identify Memory Leaks in Visual CPP Applications —— VLD内存泄漏检测工具的更多相关文章
- Cocos开发中性能优化工具介绍之Visual Studio内存泄漏检测工具——Visual Leak Detector
那么在Windows下有什么好的内存泄漏检测工具呢?微软提供Visual Studio开发工具本身没有什么太好的内存泄漏检测功能,我们可以使用第三方工具Visual Leak Detector(以下简 ...
- 内存泄漏检测工具VLD在VS2010中的使用举例
Visual LeakDetector(VLD)是一款用于Visual C++的免费的内存泄露检测工具.它的特点有:(1).它是免费开源的,采用LGPL协议:(2).它可以得到内存泄露点的调用堆栈,可 ...
- 【Visual Studio】简单内存泄漏检测方法 解决 Detected memory leaks! 问题(转)
原文转自 http://blog.csdn.net/u011430225/article/details/47840647 我的环境是: XP SP2.VS2003 最近在一个项目中, 程序退出后都出 ...
- 在VS2017中配置VLD(Visual Leak Detector)内存泄漏检测工具
首先在官方下载VLD 下载地址: https://kinddragon.github.io/vld/ 此版本为V2.5.1,为最后发布版本,下载后安装.加入你的安装路径为:VLD_Path,后面会用到 ...
- Cocos性能优化工具的开发介绍Visual Studio内存泄漏检测工具——Visual Leak Detector
然后,Windows下有什么好的内存泄漏检測工具呢?微软提供Visual Studio开发工具本身没有什么太好的内存泄漏检測功能.我们能够使用第三方工具Visual Leak Detector(下面简 ...
- vld(Visual Leak Detector) 内存泄露检测工具
初识Visual Leak Detector 灵活自由是C/C++语言的一大特色,而这也为C/C++程序员出了一个难题.当程序越来越复 杂时,内存的管理也会变得越加复杂,稍有不慎就会出现内存问题.内存 ...
- 【转】简单内存泄漏检测方法 解决 Detected memory leaks! 问题
我的环境是: XP SP2 . VS2003 最近在一个项目中,程序退出后都出现内存泄漏: Detected memory leaks! Dumping objects -> {98500} n ...
- _CrtSetBreakAlloc简单内存泄漏检测方法,解决Detected memory leaks!问题
我的环境是: XP SP2 . VS2003 最近在一个项目中,程序退出后都出现内存泄漏: Detected memory leaks! Dumping objects -> {98500} n ...
- vld,Bounds Checker,memwatch,mtrace,valgrind,debug_new几种内存泄露检测工具的比较,Valgrind Cheatsheet
概述 内存泄漏(memory leak)指由于疏忽或错误造成程序未能释放已经不再使用的内存的情况,在大型的.复杂的应用程序中,内存泄漏是常见的问题.当以前分配的一片内存不再需要使用或无法访问时,但是却 ...
随机推荐
- SQL Server 2012 联机丛书安装
已连接 Internet 的计算机: 单击"管理帮助设置"启动帮助库管理器. 在 Windows 7 中,依次选择"开始"."所有程序".& ...
- linux限制ftp账户的访问路径
1.建用户,命令行状态下,在root用户下: 运行命令:"useradd -d /home/test test" //增加用户test,并制定test用户的主目录为/home/te ...
- call()和原型继承的方法
1.call() call()方法接受两个参数,obj和arg 比如functionA.call(obj,arg) 就是说现在运行(执行)functionA这个方法,但是functionA里面的方 ...
- python3 jason & pickle
#Author by Andy#_*_ coding:utf-8 _*_import jsonimport pickledef sayhello(name): print('Hello %s' %na ...
- sql server sql语句导入数据到execl2007中
insert into OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\c.xlsx','select 字段1,字段2 FR ...
- 关于classList的API
<body class="a b c"> ...... </body> document.body.classList可以取得body的classList属 ...
- Oracle 11g密码过期问题解决方案
[问题描述]近日,使用sqlplus登陆短消息Oracle(Oracle培训 )数据库时提示“ORA-28000: 帐号被锁定”.[原因/触发因素]确定是由于oracle11g中默认在default概 ...
- Ubuntu搭建svn服务器
一,安装必须的软件包. sudo apt-getinstall subversion 二,基本的SVN服务器配置 1,新建一个目录用于存储SVN所有文件 # ...
- XObject.java 对象还没写完,希望电脑不会丢失。坏笑,早点见。
/*面向对象强调的是对象, 面向过程强调的是功能行为,打开行为,关闭行为,执行行为,把多个行为封装成对象执行更强大的功能就是面向对象,是把多个函数, 多 个行为封装在一起,单一的函数执行对象的功能太困 ...
- 全球Top10最佳移动统计分析sdk
监视应用程序的分析帮助您优化您的移动应用程序的某些元素,它也给你正确的洞察到你的营销计划.没有手机的分析软件包会有缺乏必要的数据,以帮助你提高你的应用程序需要.如果你是一个软件开发者或出版商为Goog ...