最近被一个内存泄漏的问题搞的焦头烂额,想试用下dmalloc这个工具。 同样被折磨了下,示例文件在我的开发板上还是能看到dmalloc的log。 但是我自己的程序不行,搞了半天才发现程序必须结束才能看到log。 可是我的程序是常驻的。 有什么办法?难道自己写代码搞个结束? 有其他办法吗? kill这个程序是不行的,我试过了,没有log。 请赐教,谢谢。:)
by sczhang_0001 - Linux环境编程 - 2011-02-19 10:53:48 阅读(1850) 回复(1)
dmalloc用法快速入门 Submitted by liuguangzhao on Tue, 2008-07-01 14:43 dmalloc是一个简单易用的C/C++内存leak检查工具,以一个运行库的方式发布。 dmalloc能够检查出直到程序运行结束还没有释放的内存,并且能够精确指出在 哪个源文件的第几行。 dmalloc 主页: http://dmalloc.com 支持的平台:AIX, BSD/OS, DG/UX, Free/Net/OpenBSD, GNU/Hurd, HPUX, Irix, Linux, MS-DOG, NeXT, OSF, SCO, Solaris, SunOS, Ultrix, Uni...
環境說明:
OS : Debian Linux testing
Oracle :Oracle 10.2.0.1.0
dmalloc :5.4.2-5
疑問一.
OCIEnvCreate, OCIHandleFree是否使用正確 ?
[code]
#include
版主請不要刪,我在C++版掛了幾天沒人理,只好轉這里了 !
http://bbs.chinaunix.net/viewthread.php?tid=865766&extra=page%3D4
環境說明:
OS : Debian Linux testing
Oracle :Oracle 10.2.0.1.0
dmalloc :5.4.2-5
疑問一.
OCIEnvCreate, OCIHandleFree是否使用正確 ?
[code]
#include
对于dmalloc的使用范围,在dmalloc的 主页 是如下描述的: The debug memory allocation or dmalloc library has been designed as a drop in replacement for the system's malloc, realloc, calloc, free and other memory management routines while providing powerful debugging facilities configurable at runtime. These facilities include such things as memory-leak tracking, fence-post write detection,...
1、我下载的是dmalloc.com上最新的版本。 2、我的确按guildline编译并安装了dmallocxx库 3、我的程序link了dmallocxx库 但是结果却令人失望,只有malloc分配的内存泄漏能log下来行号,而new分配的内存泄漏只有ra=xxxxx,没有行号。根据guildline使用dmalloc作者提供的一个perl工具转换log,结果发生运行错误。