手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux下的一个内存泄露测试软件

[日期:2011-02-27] 来源:Linux社区  作者:Linux [字体:大 中 小]

memprof,很小巧,无需修改代码,能看到哪些函数分配的内存,有一个缺点是只能用在Linux Gnome环境下。

详细信息见http://www.secretlabs.de/projects/memprof/。

MemProf - Profiling and leak detection
Introduction
MemProf is a tool for profiling memory usage and finding memory leaks. Its two major features are:

It can generate a profile how much memory was allocated by each function in your program.
It can scan memory and find blocks that you've allocated but are no longer referenced anywhere.
MemProf works by pre-loading a library to override the C library's memory allocation functions and does not require you to recompile your program.

One advantage MemProf has over some other similar tools that are available is that it has a nice GUI frontend and is relatively easy to use.

Changes in 0.6.2
For 0.6.2 various crashes in the memory profiling and leak handling were fixed and 0.6.2 should be as stable as 0.6 used to be. On top of the crash fixing changes from memprof-revised were included and the most prominet of them are the timegraph and memory map in the memory profiling view.

Changes in 0.6.1
The project was forked as the website vanished from the GNOME project infrastructure, the current maintainer didn't respond to inquieries and memprof is far too young too let it die. The code and releases will be hosted here and hopefully one day it will be back on the GNOME infrastructure.

Changes in 0.6
The main attraction of 0.6 is that memprof now works again, thanks to Michael Meeks. Other new features in the four years since 0.5.1 release include a rewritten profile module that handles recursion better. Also a large number of bugs have been fixed.

Changes in 0.5.1
0.5.1 reworks the way that libmemintercept.so works to work a lot better with C++ and with threads. (it fixes the infamous "Starter malloc size exceeded" bug) It also changes the data structures in the main program to use considerably less memory.

Changes in 0.5.0
The big change in this release is a port to GTK+-2.0 and GNOME-2.0, done by Kristian Rietveld. There are also quite a few bug fixes since 0.4.1.

Changes in 0.4.1
This is mostly a bug fix release - it fixes problems with recent versions of libc, a crash when using menu accelerators, a problem with leaving sockets around, and so forth.

It also includes a bunch more translations and a feature to do regular-expression based exclusion of funtions from Martin Baulig.

Changes in 0.4.0
The backend in 0.4.0 has been almost totally rewritten to support profiling threaded programs and to follow the children of programs that fork.

The front end has also been improved in a number of ways, translations have been added for 12 languages, and numerous bugs have been fixed by myself and others.

Numerous bugs have most likely also been added, so please try it out, find them, and let me know.

Requirements
For the interface, memprof requires:

GTK+ 2.0
GConf 2.0
libglade 2.0
These (or newer versions) are all available from http://ftp.gnome.org/pub/GNOME/sources/ but if binary packages are available from your distribution, it's much easier to install them that way.

libbfd and libiberty from the GNU binutils distribution. (Debian users will probably need to install the binutils-dev package)
Linux (kernel version 2.2 will work better)
GNU libc (2.0 or or newer will work, but 2.0 may produce warnings when compiling. Most recent development has been done with version 2.3.)

linux
相关资讯       Linux教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款