vs2008内存泄露检測得到完美解决
版权声明:原创文章。转载请注明出处。本博新地址www.iaccepted.net https://blog.csdn.net/IAccepted/article/details/27646679
Visual Leak Detector is a free, robust, open-source memory leak detection system for Visual C++.
It's pretty easy to use. After installing it, you just need to tell Visual C++ where to find the included header and library file.
Then it can be used with any C/C++ project simply by adding the following line to your code:
#include <vld.h>
When you run your program under the Visual Studio debugger, Visual Leak Detector will output a memory leak report at the end of your debugging session. The leak report includes the full call stack showing how any leaked memory blocks were allocated. Double-click
on a line in the call stack to jump to that file and line in the editor window.
It's a very effective way to quickly diagnose, and fix, memory leaks in C/C++ applications.
The
main difference between the CRT
Debug Library and VLD, is
that Visual Leak Detector shows you
the complete callstack used
for memory allocation has
led to the leak.
For example:
- ---------- Block 1199 at 0x04BE1058: 136 bytes ----------
- Call Stack:
- d:\Foobar\FooLog.cpp (26): FooLog::getInstance
- d:\Foobar\FooMain.cpp (75): FooMain::init
- f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (578): __tmainCRTStartup
- f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (403): WinMainCRTStartup
- 0x759A3677 (File and line number not available): BaseThreadInitThunk
- 0x770C9D42 (File and line number not available): RtlInitializeExceptionChain
- 0x770C9D15 (File and line number not available): RtlInitializeExceptionChain
- Data:
- 9C 33 2D 6B 74 2A 2D 6B C8 11 BE 04 00 00 00 00 .3-kt*-k ........
- 00 00 00 00 70 14 BB 6C 70 14 BB 6C 00 00 00 00 ....p..l p..l....
- 00 00 00 00 68 14 BB 6C 68 14 BB 6C 00 00 00 00 ....h..l h..l....
- 00 00 00 00 6C 14 BB 6C 6C 14 BB 6C 20 12 BE 04 ....l..l l..l....
- 00 00 00 00 CD 00 CD CD 00 00 00 00 01 CD CD CD ........ ........
- 68 14 BB 6C 78 33 2D 6B 00 00 00 00 00 00 00 00 h..lx3-k ........
- 00 00 00 00 01 02 00 00 06 00 00 00 00 00 00 00 ........ ........
- 00 00 00 00 00 00 00 00 88 11 BE 04 5C 10 BE 04 ........ ....\...
- 00 00 00 00 20 CD CD CD ........ ........
YES,it's so easy,what we need to do is just include <vld.h>,then the information of
memory leaking will be shown on the screen.
此工具0积分下载地址:
visual leak detector
vs2008内存泄露检測得到完美解决的更多相关文章
- 内存泄露检測及cvClone造成的泄露
调了几个小时,到最后发现内存泄露的原因是opencv的cvClone函数,採用cvCopy函数后,问题解决. vs2010使用vld进行内存泄露检測 (1) 下载vld工具 (2) 将D:\Progr ...
- Visual Studio内存泄露检測工具
使用简单介绍 在敲代码的过程中.难免会遇到内存泄露的时候.这个时候假设手工查找内存泄露,不说方法没有通用的,就是真的要自己手工查找也是非常耗时间和精力的.诚然.我们能够借助一些工具,并且我们还 ...
- C++内存泄露检測原理
转自:http://hi.baidu.com/jasonlyy/item/9ca0cecf2c8f113a99b4981c 本文针对 linux 下的 C++ 程序的内存泄漏的检測方法及事实上现进行探 ...
- c++程序内存泄露检測工具
功能: 用于检測c++程序的内存泄露. 原理: 事实上非常easy,就是通过函数的重载机制,捕获应用程序的new, new[] , delete , delete[], malloc,calloc,f ...
- Linux C 编程内存泄露检測工具(二):memwatch
Memwatch简单介绍 在三种检測工具其中,设置最简单的算是memwatch,和dmalloc一样,它能检測未释放的内存.同一段内存被释放多次.位址存取错误及不当使用未分配之内存区域.请往http: ...
- Visual C++ 2012/2013的内存溢出检測工具
在过去,每次编写C/C++程序的时候,VLD差点儿是我的标配.有了它,就能够放心地敲代码,随时发现内存溢出. VLD最高可支持到Visual Studio 2012.不知道以后会不会支持Visual ...
- Android内存泄漏检測与MAT使用
公司相关项目须要进行内存优化.所以整理了一些分析内存泄漏的知识以及工作分析过程. 本文中不会刻意的编写一个内存泄漏的程序,然后利用工具去分析它.而是通过介绍相关概念,来分析怎样寻找内存泄漏.并附上自己 ...
- LeakCanary:简单粗暴的内存泄漏检測工具
差点儿每一个程序猿在开发的过程中都会遇到内存泄漏.那么我们怎样检測到app是否哪里出现内存泄漏呢?square公司推出了一款简单粗暴的检測内存泄漏的工具-- LeakCanary 什么是内存泄漏? 内 ...
- MySQL常见内存不足启动失败的完美解决方法
Move to https://www.jb51.net/article/136432.htm
随机推荐
- [SCOI2012] 喵星球上的点名
Description 给定 \(N\) 个姓名串和 \(M\) 个点名串.询问每个点名串点到了多少姓名和每个姓名串被点到了几次.\(N\leq 5\cdot 10^4,M\leq 10^5\). S ...
- ServerSocket和Socket
前言 用ServerSocket和Socket做了个Server.Client通信的demo,以及学习下在这个demo过程中用到java.net.java.io包下几个常用的类. Server imp ...
- ssh采用expect实现自动输入密码登录、拷贝
1. 引言 最近做了一个项目,需要频繁与另一台主机进行文件的传输:中间想到了很多方式:FTP.samba.curl等,但是还是感觉scp最好用. SCP使用教程可参阅:http://www.jb51. ...
- python取余
a=-7,b=3, a % b = 2 #取余 a-((a/b)*b) a / b= -3 #整除 int(math.floor(-7/3.0))
- int和Integer有什么区别?
Java提供两种不同的类型:引用类型和原始类型(或内置类型): int是Java的原始数据类型,Integer是java为int提供的封装类. java为每个原始类型提供了封装类: 原始类型:bool ...
- c# 正则格式化文本防止SQL注入
/// <summary> /// 格式化文本(防止SQL注入) /// </summary> /// <param name="str">&l ...
- 菜鸟入门【ASP.NET Core】5:命令行配置、Json文件配置、Bind读取配置到C#实例、在Core Mvc中使用Options
命令行配置 我们通过vs2017创建一个控制台项目CommandLineSample 可以看到现在项目以来的是dotnet core framework 我们需要吧asp.net core引用进来 ...
- 使用Django创建网站项目<二>
上一篇:Windows安装diango框架<一> 创建项目,启动服务器 利用安装好的django包的django-admin.py创建项目,命令 python django-admin. ...
- One Person Game(zoj3593+扩展欧几里德)
One Person Game Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Submit Status ...
- pycharm技巧
常用快捷键 1.Ctrl + Enter:在下方新建行但不移动光标: 2.Shift + Enter:在下方新建行并移到新行行首: 3.Ctrl + /:注释(取消注释)选择的行: 4.Ctrl + ...