Memory Debuggers
来源:互联网 发布:mac自动播放照片 编辑:程序博客网 时间:2024/05/17 01:07
http://elinux.org/Memory_Debuggers
Memory Debuggers
Several tools exist for finding memory leaks or for reporting individual memory allocations of a program. These tools help analyze memory usage patterns, detect unbalanced allocations and frees, report buffer over- and under-runs, etc.
Contents
[hide]- 1 mtrace
- 2 memwatch
- 3 mpatrol
- 4 dmalloc
- 5 dbgmem
- 6 valgrind
- 7 Electric Fence
- 8 Tutorials or Overviews
mtrace
mtrace is a builtin part of glibc which allows detection of memory leaks caused by unbalanced malloc/free calls. To use it, the program is modified to call mtrace() and muntrace() to start and stop tracing of allocations. A log file is created, which can then be scanned by the 'mtrace' Perl script. The 'mtrace' program lists only unbalanced allocations. If source is available it can show the source line where the problem occurred. mtrace can be used on both C and C++ programs.
See the mtrace wikipedia article for more information.
memwatch
memwatch is a program that not only detects malloc and free errors but also reads and writes beyond the allocated space (buffer over and under-runs). To use it, you modify the source to include the memwatch code, which provides replacements for malloc and free.
Some things that memwatch does not catch are writing to an address that has been freed and reading data from outside the allocated memory.
mpatrol
mpatrol appears to be like memwatch.
See http://mpatrol.sourceforge.net/
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, file/line number reporting, and general logging of statistics."
This library can be used without modifying the existing program, and uses environment variables to control it's operation and set of issues to log.
It's home page is at: http://dmalloc.com/
See Cal Erickson's article (link below, page 2) for information about using this system.
dbgmem
dbgmem looks like another dynamic library replacement tool, similar to dmalloc (but possibly having less features)
See http://dbgmem.sourceforge.net/
valgrind
valgrind does dynamic binary instrumentation to analyze the program, and provides a number of memory problem detection tools and profiling tools. Unfortunately, as of July 2010 it is only available for x86 and ppc64 architecture platforms.
See Valgrind
Electric Fence
See Electric Fence
Tutorials or Overviews
- Memory Leak Detection in Embedded Systems by Cal Erickson, Linux Journal, September 2002
- This article mentions mtrace, memwatch and dmalloc
- Development Tools
- Memory Debuggers
- Python debuggers
- compile collected debuggers
- POP SS and Debuggers
- Windows Debuggers: Part 1: A WinDbg Tutorial
- A brief overview of the Windows debuggers
- 【破解利器】调试工具篇(Debuggers)
- Windows Debuggers: Part 1: A WinDbg Tutorial
- Memory
- Memory
- memory
- memory
- Memory
- memory
- Memory
- Memory
- Memory
- Memory
- asp.net 导入excel表格
- 项目调试Assertion failed
- 上海英语播音学校比较好
- 使用DialogFragment托管dialog
- GRE词汇分类之与装修词汇
- Memory Debuggers
- Android Studio 类库中配置Jpush 报错 java.lang.UnsatisfiedLinkError解决方案
- Ubuntu 14.04一步一步安装Openstack Kilo版本-2
- 隐马尔科夫学习六(三)
- Leetcode[217]-Contains Duplicate
- 使用gdb调试C++程序时,感觉不按流程执行,跳来跳去的解决办法
- 【数据结构】栈的应用——中缀表达式求值(c++)
- C#实现一个简单的 Restful Service
- Ubuntu 14.04一步一步安装Openstack Kilo版本-3