内存泄漏检测http://www.cnblogs.com/yixiaoyang/archive/2010/12/10/1902255.html
来源:互联网 发布:胜利足球欧赔数据库吧 编辑:程序博客网 时间:2024/04/27 22:10
vs环境下的内存泄露检测工具
Posted on 2010-12-10 14:16 晓彻 阅读(633) 评论(0) 编辑 收藏这个挺有用的。记录一下.只适用于windows环境。
首先在代码头中加入:
1
2
3
4
5
6
7
8
9
10
11
12
13
//if using the check of leak memory
#define USING_LEAK_CHECK 1
#ifndef _crtdbg_map_alloc
#define _crtdbg_map_alloc
#endif
#include <stdlib.h>
#if USING_LEAK_CHECK
#include <crtdbg.h>
#endif
#include <stdio.h>
然后在程序最后加上:
1
2
3
4
5
#if USING_LEAK_CHECK
printf
(
"check memory leak ...\n"
);
_CrtDumpMemoryLeaks();
printf
(
"check over.\n"
);
#endif
在debug模式下进行调试,可以检测到常规的内存泄漏问题。
测试了一下,效果不错:
0 0
- 内存泄漏检测http://www.cnblogs.com/yixiaoyang/archive/2010/12/10/1902255.html
- C/C++内存泄漏及检测 http://www.cnblogs.com/skynet/archive/2011/02/20/1959162.html
- JPA & Hibernate 注解 (转http://www.cnblogs.com/minideas/archive/2010/12/31/1922672.html)
- http://www.cnblogs.com/iminto/archive/2010/12/23/1915232.html
- 根据两点经纬度计算距离http://www.cnblogs.com/ycsfwhh/archive/2010/12/20/1911232.html
- CMake 使用方法 http://www.cnblogs.com/lyq105/archive/2010/12/03/1895067.html
- elphi之self http://www.cnblogs.com/keycode/archive/2010/10/16/1853128.html
- http://www.cnblogs.com/YSO1983/archive/2010/06/10/1755665.html
- http://www.cnblogs.com/ringofthec/archive/2010/10/26/luabindobj.html
- http://www.cnblogs.com/jicheng1014/archive/2010/01/10/1643366.html
- vimrc 转自 http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html
- 揭开Socket编程的面纱http://www.cnblogs.com/goodcandle/archive/2005/12/10/socket.html
- vim配置http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html
- 堆内存和栈内存,http://www.cnblogs.com/lln7777/archive/2012/03/14/2396164.html,
- HTML解析原理http://www.cnblogs.com/NetSos/archive/2010/11/29/1891194.html
- HTTP协议的chunked编码 http://www.cnblogs.com/zhaozhan/archive/2010/08/24/1807639.html
- Android 轻松实现语音识别(转http://www.cnblogs.com/TerryBlog/archive/2010/11/12/1875875.html)
- 【转】JQuery跨域请求 (转http://www.cnblogs.com/myaspnet/archive/2010/12/30/1922335.html)
- RAC 执行root.sh 报错 libcap.so.1: cannot open shared object file: No such file or directory
- 【行人检测】之Joint Deep Learning联合深度学习(附源码)
- 在构建好XPE操作系统上增加EWF功能
- lua 函数
- JavaWeb项目动态导出Excel可弹出下载(基于POI和java反射机制,可选择导出项,读取数据库注释作为表头,可合计)
- 内存泄漏检测http://www.cnblogs.com/yixiaoyang/archive/2010/12/10/1902255.html
- Linux创建动态库和静态库
- Android 关于图片的缩放功能
- 机器学习面试题合集Collection of Machine Learning Interview Questions
- 详细解析Raid0、Raid0+1、Raid1、Raid5四者的区别
- ssl在tomcat 中的配置
- day1_android快捷键
- spark rdd转dataframe 写入mysql的示例
- 欢迎使用CSDN-markdown编辑器