Appendix K Related software
The mpatrol library was designed to solve most common heap-related problems,
but there may be some cases where a different approach is needed, or a
commercial package is required. I have attempted to provide an overview of
the different types of malloc libraries and memory debuggers available below,
along with a comprehensive list of related software.
The most basic type of heap debugging system simply requires the redefinition
of malloc()
, realloc()
and free()
(and related functions)
with debugging versions that record the file and line number at which
allocations occur. This might require modifications to the source code in order
to call these new functions or it can be done through preprocessor macros which
will require all source files using the memory allocation functions to be
recompiled. Such a system will most likely live on top of the existing system
malloc library, but will provide an additional layer with which to store more
information for debugging purposes. MEM by Walter Bright is a good example of
this type of library.
On many operating systems it is usually possible to write replacements for the
normal memory allocation routines and place them in a library so that they can
be linked in to override the system malloc library without requiring
recompilation of any source files. Such malloc libraries must take control of
the heap directly and so usually contain more features, including being able to
track memory leaks and place fence posts around allocations. Dbmalloc by Conor
P. Cahill and Dmalloc by Gray Watson are two of the most popular of these types
of libraries since they are available on a wide range of platforms. Electric
Fence by Bruce Perens also makes use of the memory protection facilities found
in UNIX systems in order to force programs that access free or freed memory or
read or write beyond the bounds of a memory allocation to crash at the point
that the illegal memory access is made, rather than crashing at the next memory
allocation.
For debugging all memory access errors (not just those on the heap) it is
necessary to modify (instrument) the machine code that is to be run so that each
individual load from memory and store to memory will be checked. One method of
doing this is to modify the code produced by a compiler (such as is done by
Checker written by Tristan Gingold) but this has the disadvantage of only
working within the object files that have been produced by that compiler. It is
also possible to modify the source code itself using source to source
translation (such as is done by Parasoft Insure++) or instrument all accesses to
memory in assembler source files (as performed by APurify written by Samuel
Devulder). However, both of these methods suffer from the same drawback as
compiler-generated instrumentation. Yet another alternative is to wait until
link-time and then instrument the individual object files and libraries before
they are linked into an executable file. This is effectively what Purify from
Rational Software does, although Memory Advisor from PLATINUM Technology does
roughly the same except that it disassembles the object files into a
platform-independent format before instrumenting them.
Rather than modifying a program in order to add debugging code, it is sometimes
possible to use a dedicated memory debugger in order to quickly catch any
problems. ZeroFault from The Kernel Group debugs all memory-related operations
in a program while it is running, whilst AProbe from OC Systems allows users to
dynamically add probe modules at run-time in order to locate errors or perform
profiling. If such a memory debugger is not available for your system, you may
still be able to dynamically link a malloc library into your application at
run-time if the operating system supports it. NJAMD by Mike Perry makes
extensive use of this feature on some UNIX systems. On operating systems that
do not support virtual memory but have hardware memory protection, it is
sometimes possible to trap memory errors before they bring down the whole
system. On the Amiga, Enforcer by Michael Sinz runs in the background and
detects many common memory access errors in running applications, whilst on the
Macintosh, QC by Onyx Technology provides roughly the same functionality.
A list of over ninety five different items of software which help in debugging
dynamic memory allocation problems is given below1. They
all provide some of the features that mpatrol contains and you may wish to use
one of them to solve your problem if you have trouble using mpatrol. I have
only ever used CSRI malloc, Dbmalloc, Dmalloc, Electric Fence and Mprof, so I
can't vouch for any of the others, although if you have any recommendations
feel free to let me know so I can add them to this list. In particular, there
seems to be a shortage of such programs for Netware platforms. Note that there
is a comparison of a few of the following programs at
http://www.consistent.org/terran/memorycheck.shtml which might help
illustrate the differences between the various tools.
- AProbe
- Author
- OC Systems (info@ocsystems.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.aprobe.com/
- Overview
- Instruments a program using Dynamic Action Linking in order to track down memory
corruption and monitor memory usage, among other things.
- APurify
- Author
- Samuel Devulder (Samuel.Devulder@info.unicaen.fr)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://wuarchive.wustl.edu/~aminet/dirs/dev_debug.html
- Overview
- Instruments an assembler source file to insert code that checks all memory
accesses.
- BoundsChecker
- Author
- NuMega Corporation (info@numega.com)
- License
- Commercial Software
- Platforms
- Windows, MS-DOS
- Location
- http://www.numega.com/
- Overview
- Detects and diagnoses errors in static, stack and heap memory and in memory and
resource leaks.
- C++ Debugging Support Library (libcwd)
- Author
- Carlo Wood carlo@alinoe.com
- License
- Q Public License
- Platforms
- Various UNIX
- Location
- http://sourceforge.net/projects/libcw/
- Overview
- A C++ debugging library that can also detect memory corruption and memory leaks.
- Ccmalloc
- Author
- Armin Biere (biere@inf.ethz.ch)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http://www.inf.ethz.ch/personal/biere/projects/ccmalloc/
- Overview
- Can interface with gdb to find memory leaks, multiple deallocations
and memory corruptions in C or C++ programs.
- Chaperon
- Author
- John Reiser (jreiser@BitWagon.com)
- License
- Commercial Software
- Platforms
- Linux
- Location
- http://www.bitwagon.com/chaperon.html
- Overview
- Runs existing Intel Linux binary application programs, but checks for and
reports bad behaviour in accessing memory.
- Checker
- Author
- Tristan Gingold (bug-checker@gnu.org)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http://www.gnu.org/software/checker/checker.html
- Overview
- Detects illegal memory accesses when reading from uninitialised memory, writing
to freed memory or outside memory blocks. Also contains a garbage collector for
detecting memory leaks.
- CMEM
- Author
- Brett Hunsaker (hunsaker@eisner.decus.org)
- License
- Free Software
- Platforms
- VMS
- Location
- http://www.openvms.compaq.com/freeware/CMEM/
- Overview
- Provides debugging versions of the C run-time library memory allocation
routines, with support for stack tracebacks and page protection.
- CMM (Customisable Memory Manager)
- Author
- Giuseppe Attardi (attardi@di.unipi.it),
Tito Flagella (tito@di.unipi.it) and
Pietro Iglio (iglio@di.unipi.it)
- License
- Free Software
- Platforms
- Various UNIX, Windows, MacOS, DOS
- Location
- ftp://ftp.di.unipi.ti/pub/project/posso/cmm/
- Overview
- A memory management facility supporting memory intensive applications in C++,
with support for multiple heaps (each one optionally implementing a different
storage discipline) and garbage collection.
- CSRI malloc
- Author
- Mark Moraes (moraes@deshaw.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- ftp://ftp.cs.toronto.edu/pub/moraes/malloc.tar.gz
- Overview
- A library of dynamic memory allocation functions with limited debugging and
profiling support and detection of memory leaks. Also comes with a graphical
tool to display a dynamic picture of the heap.
- DBAlloc
- Author
- Peter MacDonald (peter@pdqi.com)
- License
- Free Software
- Platforms
- Various UNIX, Windows
- Location
- http://browsex.com/dballoc.html
- Overview
- A memory leak and fence-post malloc debug library.
- Dbmalloc
- Author
- Conor P. Cahill (cpcahil@virtech.vti.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://dickey.his.com/dbmalloc/dbmalloc.html
- Overview
- Provides replacements for memory management library functions and provides a
full set of debugging features which detect memory overruns and other types of
misuse.
- Dbmalloc
- Author
- Michael McTernan (mm7323@bris.ac.uk)
- License
- Free Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.cs.bris.ac.uk/~mm7323/DbMalloc/
- Overview
- A drop-in replacement for the C memory allocation functions, providing
facilities for quickly finding memory leaks.
- Debauch
- Author
- Jon A. Christopher (jac8792@tamu.edu)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://mackerel.tamu.edu/jon/gnu/
- Overview
- A memory allocation debugger for C which will detect memory leaks, corrupted
memory, stores to freed memory and more.
- Debug Heap
- Author
- IBM Corporation (info@ibm.com)
- License
- Commercial Software
- Platforms
- IBM AS/400
- Location
- http://www.as400.ibm.com/developer/porting/heapexternal.html
- Overview
- A heap debugging environment with stack traceback for IBM AS/400 servers.
- DebugObject
- Author
- Beniamin Cherniavsky (cben@israel.crosswinds.net)
- License
- GNU General Public License
- Platforms
- Various UNIX, Windows
- Location
- http://www.crosswinds.net/~cben/objc/
- Overview
- A set of classes for debugging dynamic memory problems in Objective C.
- Dmalloc
- Author
- Gray Watson (gray@burger.letters.com)
- License
- Free Software
- Platforms
- Various UNIX, Windows, MS-DOS
- Location
- http://www.dmalloc.com/
- Overview
- A drop-in replacement for the system's memory management routines, providing
powerful debugging facilities configurable at run-time. Formerly known as
Malloc_Dbg.
- DPCRTLMM
- Author
- David Duncan Ross Palmer (overlord@daybologic.co.uk)
- License
- GNU General Public License
- Platforms
- Various UNIX, Windows, MS-DOS
- Location
- http://www.daybologic.co.uk/dev/dpcrtlmm/
- Overview
- Detects failures to release memory and attempts to release memory which has not
been allocated, and can also provide statistics and logging facilities.
- Electric Fence
- Author
- Bruce Perens (bruce@pixar.com)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- ftp://ftp.perens.com/pub/ElectricFence/
- Overview
- Uses virtual memory hardware to protect dynamically allocated memory in order to
detect illegal memory accesses.
- Enforcer
- Author
- Michael Sinz (Enforcer@sinz.org)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://www.iam.com/amiga/enforcer.html
- Overview
- Sets up MMU tables to watch for illegal accesses to memory, such as the low page
and non-existent pages.
- FDA (Free Debug Allocator)
- Author
- Thomas Helvey (tomh@inxpress.net)
- License
- GNU General Public License
- Platforms
- Linux, Windows
- Location
- http://www.debian.org/Packages/unstable/devel/fda.html
- Overview
- Provides routines that can be plugged in to replace
malloc()
,
calloc()
, realloc()
and free()
.
- Fortify
- Author
- Simon Bullen (sbullen@cybergraphic.com.au)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://www.geocities.com/SiliconValley/Horizon/8596/fortify.html
- Overview
- Provides a fortified shell for memory allocations, trapping memory leaks,
writes beyond and before memory blocks and writes to freed memory.
- Gabe's Debug Library
- Author
- Gabriel Sechan gsechan@hotmail.com
- License
- Free Software
- Platforms
- Windows
- Location
- http://sourceforge.net/projects/debuglib/
- Overview
- A debugging library for C++ which performs dynamic memory management and looks
for potential problems and memory leaks.
- GC (Garbage Collector)
- Author
- Hans-J. Boehm (boehm@acm.org)
- License
- Free Software
- Platforms
- Various UNIX, AmigaOS, Windows, MS-DOS, MacOS
- Location
- http://www.hpl.hp.com/personal/Hans_Boehm/gc/
- Overview
- A general-purpose, garbage-collecting storage allocator that is intended to be
used as a plug-in replacement for
malloc()
, but can also be used to
detect memory leaks.
- GCAlloc
- Author
- Joel Bartlett (bartlett@decwrl.dec.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- ftp://gatekeeper.dec.com/pub/DEC/CCgc/
- Overview
- A highly-portable generational, mostly-copying garbage collector for C++.
- GlowCode
- Author
- Electric Software, Inc. (info@glowcode.com)
- License
- Commercial Software
- Platforms
- Windows
- Location
- http://www.glowcode.com/
- Overview
- Provides a profiler, call coverage tool and resource browser which can detail
memory leaks.
- GMemLogger
- Author
- Yves Mettier (ymettier@libertysurf.fr)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://sourceforge.net/projects/gmemlogger/
- Overview
- Logs allocated memory for the purpose of detecting memory leaks.
- Great Circle
- Author
- Geodesic Systems (info@geodesic.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.geodesic.com/
- Overview
- Provides complete heap profiling, allowing programmers to see what parts of a
program are using the most memory with symbolic stack tracing.
- HeapAgent
- Author
- MicroQuill (info@microquill.com)
- License
- Commercial Software
- Platforms
- Windows
- Location
- http://www.microquill.com/
- Overview
- Instruments the heap to provide heap error detection without the need to
recompile any source code.
- HeapCheck
- Author
- Thanassis Tsiodras (ttsiod@softlab.ntua.gr)
- License
- GNU General Public License
- Platforms
- Windows
- Location
- http://www.image.ece.ntua.gr/~ttsiod/HeapCheck.html
- Overview
- A debugging memory allocator that can detect invalid read/write accesses to heap
memory, and also detects memory leaks.
- HeapManager
- Author
- Andrew Wulf (heapmanager@biit.com)
- License
- Free Software
- Platforms
- MacOS
- Location
- http://www.biit.com/
- Overview
- Provides a general-purpose dynamic memory allocation debugging package with
symbolic stack traceback.
- IDH
- Author
- Ivan Skytte Jorgensen (isj@image.dk)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.platypus.adsl.dk/idh/index.html/
- Overview
- Detects most overwrites, stale pointers, wild pointers, double-free and invalid
mix of heap management functions.
- Insure++
- Author
- ParaSoft (info@parasoft.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.parasoft.com/
- Overview
- Uses Source Code Instrumentation and Runtime Pointer Tracking technologies to
pinpoint memory corruption, memory leaks, operations on unrelated pointers and
more. The Inuse graphical memory usage display tool is also provided with this
software.
- JMalloc
- Author
- Jeff Dunlop
- License
- Free Software
- Platforms
- Windows, MS-DOS
- Location
- http://www.snippets.org/
- Overview
- Provides tracing and debugging for
malloc()
and operator new
.
- JProbe
- Author
- KL Group (info@klgroup.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.klgroup.com/
- Overview
- Helps pinpoint memory leaks in Java applications by tracking which objects
hold references to other objects, and allows visualisation of memory usage in
real-time.
- Leak
- Author
- Christopher Phillips (pefv700@hermes.chpc.utexas.edu)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://sources.isc.org/devel/memleak/leak.txt
- Overview
- Logs all calls to
malloc()
and related functions to database files with
the filename and line number, then attempts to validate reallocations and
deallocations and detect memory leaks.
- Leak
- Author
- Josh McCormick (jmccorm@galstar.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.galstar.com/~jmccorm/leak/
- Overview
- A simple shell script that monitors the system looking for processes which leak
memory.
- LeakBug
- Author
- Christian Hammond (chipx86@portaldesign.net),
Domenico Andreoli (cavok@filibusta.crema.unimi.it) and
Gerry Jo Jellestad (gerry@c64.org)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http://www.gnupdate.org/
- Overview
- A memory leak tracer that specializes in detecting leaks from a program's own
calls to
malloc()
, strdup()
, etc, but does not detect leaks from
outside libraries.
- Leakers
- Author
- Gabriel M. Deal (gmd@yellowleaf.org)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http://www.yellowleaf.org/gmd/software/leakers/
- Overview
- Detects memory allocation errors by writing a log file and then examining it
for memory leaks and attempts to free memory multiple times.
- LeakTracer
- Author
- Erwin Andreasen (erwin@andreasen.org)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.andreasen.org/LeakTracer/
- Overview
- Detects memory leaks in C++ programs by overriding
operator new
and
operator delete
.
- Leaky
- Author
- Kipp Hickman (kipp@netscape.com)
- License
- Netscape Public License
- Platforms
- Linux
- Location
- http://www.mozilla.org/unix/leaky.html
- Overview
- A program which helps find memory leaks and helps debug reference count problems
with xpcom objects.
- LibKmalloc
- Author
- Akira Higuchi (a@kondara.org)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://www.kondara.org/~a/libkmalloc.html
- Overview
- A tiny malloc debugger which detects multiple frees and buffer overruns and
underruns.
- LibSafe
- Author
- AT&T Bell Labs (libsafe@research.bell-labs.com)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://www.bell-labs.com/org/11356/libsafe.html
- Overview
- Protects a process against the exploitation of buffer overflow vulnerabilities
in process stacks.
- Malloc Debug
- Author
- Brandon S. Allbery allbery@ncoast.org
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.leo.org/pub/comp/usenet/comp.sources.misc/malloc-debug/
- Overview
- A debugging malloc package with stack traceback capability.
- Malloc Debug Library
- Author
- Rammi (rammi@quincunx.escape.de)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.escape.de/users/quincunx/rmdebug.html
- Overview
- Implements wrappers for the normal heap handling functions.
- MallocTrace
- Author
- Mark Brader (msb@sq.sq.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- ftp://ftp.uu.net/usenet/comp.sources.unix/volume18/malloc-trace.Z
- Overview
- A malloc package with call stack tracebacks.
- MalTrace
- Author
- Michael Schwartz (schwartz@cs.washington.edu)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.mit.edu/afs/sipb/user/tytso/News/maltrace
- Overview
- Traces all calls to
malloc()
and free()
in order to detect memory
leaks.
- Mark_Malloc
- Author
- Sed (sed@free.fr)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://sed.free.fr/mark_malloc
- Overview
- Marks memory allocations in order to detect memory leaks.
- MCheck
- Author
- Ronald Veldema (rveldema@cs.vu.nl)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://www.cs.vu.nl/~rveldema/mcheck/mcheck.html
- Overview
- A memory usage and malloc checker for C and C++. Comes with a Java application
for browsing the trace files produced.
- MEM
- Author
- Walter Bright
- License
- Free Software
- Platforms
- MS-DOS
- Location
- http://www.snippets.org/
- Overview
- A set of functions for debugging pointer and memory allocation problems.
- MemCheck
- Author
- Stratosware Corporation (info@stratosware.com)
- License
- Commercial Software
- Platforms
- Windows
- Location
- http://www.stratosware.com/
- Overview
- Detects various run-time errors related to operating system resources and
provides information on memory leaks.
- MemCheck
- Author
- IBM Corporation (info@ibm.com)
- License
- Commercial Software
- Platforms
- IBM OS/390
- Location
- http://www.s390.ibm.com/oe/tools/memcheck_2_1.html
- Overview
- Aids the discovery of memory leaks in single- and multi-threaded C/C++ programs.
- MemDebug
- Author
- Rene Schmit (rene.schmit@bss.lu)
- License
- Free Software
- Platforms
- Various UNIX, Windows, MS-DOS, MacOS
- Location
- http://www.bss.lu/Memdebug/Memdebug.html
- Overview
- Provides memory management error detection, memory usage error detection, memory
usage profiling and error simulation.
- MemLeak
- Author
- Keith Packard (keithp@ncd.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- ftp://ftp.x.org/pub/R6.4/xc/util/memleak/
- Overview
- Replaces the C library allocation functions and provides extensive memory
checking, locating lost memory, detecting free memory still in use and stores
to free memory along with stack tracebacks.
- Memory Advisor
- Author
- PLATINUM Technology (info@platinum.com)
- License
- Commercial Software
- Platforms
- Various UNIX
- Location
- http://www.platinum.com/
- Overview
- Disassembles an object module into system-independent assembler code, inserts
error checking instructions, then re-assembles the code. Can also replace
existing malloc libraries in order to provide greater error checking. Formerly
known as Sentinel.
- Memory Sleuth
- Author
- TurboPower (info@turbopower.com)
- License
- Commercial Software
- Platforms
- Windows
- Location
- http://www.turbopower.com/
- Overview
- Quickly tracks down memory leaks and resource allocation errors with C++Builder
and Delphi.
- Memory Validator
- Author
- Software Verification (sales@softwareverify.com)
- License
- Commercial Software
- Platforms
- Windows
- Location
- http://www.softwareverify.com/
- Overview
- Detects memory and resource leaks.
- Memprof
- Author
- Owen Taylor (otaylor@redhat.com)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://people.redhat.com/otaylor/memprof/
- Overview
- A tool for profiling memory usage and detecting memory leaks.
- Memproof
- Author
- AutomatedQA (info@totalqa.com)
- License
- Free Software
- Platforms
- Windows
- Location
- http://www.totalqa.com/
- Overview
- A memory and resource leak debugger for Borland's family of Windows compilers.
- MemTest
- Author
- Jim Buchanan (jbuchana@iquest.net)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- ftp://ftp.loxinfo.co.th/pub/unix/utils/mem_test-0_10_tar.gz
- Overview
- Helps locate memory leaks in a program under development by creating a log file
that records most memory allocations and deallocations.
- MemTrace
- Author
- Nico Hoogervorst (nico@knoware.nl)
- License
- Free Software
- Platforms
- Windows
- Location
- http://utopia.knoware.nl/users/nico/tools/c/memtrace/
- Overview
- A simple enhancement for C source code which makes it easier to find memory
leaks.
- MemTrace
- Author
- Frank Pilhofer (fp@informatik.uni-frankfurt.de)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.informatik.uni-frankfurt.de/~fp/Tools/MemTrace/
- Overview
- Searches for memory leaks in a program and uses various platform-specific
features to record a stack trace each time a memory chunk is allocated.
- MemWatch
- Author
- Johan Lindh (johan@link-data.com)
- License
- Free Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.link-data.com/
- Overview
- A fault-tolerant memory leak and corruption detection tool.
- MemWatch
- Author
- Doug Walker (walker@unx.sas.com)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://wuarchive.wustl.edu/~aminet/dirs/dev_debug.html
- Overview
- Provides replacement memory allocation routines for adding lots of memory
debugging features that you link into your program.
- MemWatch
- Author
- Sundial Services (info@sundialservices.com)
- License
- Free Software
- Platforms
- Windows
- Location
- http://www.sundialservices.com/download/memwatch.pas
- Overview
- Provides replacement dynamic memory allocation functions for Delphi which look
for memory underwrites and overwrites.
- MM (Shared Memory Library)
- Author
- Ralf S. Engelschall (rse@engelschall.com)
- License
- Free Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.engelschall.com/sw/mm/
- Overview
- Simplifies the usage (and can help debug) the use of shared memory between
related processes.
- MM
- Author
- Dave Clements (clements@cs.uoregon.edu)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://www.cirl.uoregon.edu/clements/memoryManager.html
- Overview
- Overrides the C dynamic memory allocation functions to provide better debugging
capabilities.
- Mmalloc
- Author
- Mike Haertel (mike@ai.mit.edu) and Fred Fish (fnf@cygnus.com)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http://www.gnu.org/
- Overview
- Uses
mmap()
to allocate separate pools of memory which can be mapped onto
files for later reuse.
- MPR
- Author
- Taj Khattra (taj.khattra@pobox.com)
- License
- Free Software
- Platforms
- Linux
- Location
- http://metalab.unc.edu/pub/Linux/devel/lang/c/mpr-2.0.tar.gz
- Overview
- Attempts to find memory leaks in C/C++ programs by writing a log file during
program execution, which can then be processed for obtaining further
information.
- Mprof
- Author
- Ben Zorn (zorn@microsoft.com)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- ftp://gatekeeper.dec.com/pub/misc/mprof-3.0.tar.Z
- Overview
- Profiles the dynamic memory allocation behaviour of programs by logging details
for each function than makes a memory allocation, including call stack
tracebacks.
- MSS (Memory Supervision System)
- Author
- Juan Jesus Alcolea Picazo (a920101@zipi.fi.upm.es) and
Peter Palotas (blizzar@hem1.passagen.se)
- License
- GNU General Public License
- Platforms
- Linux, Windows, MS-DOS
- Location
- http://hem.passagen.se/blizzar/mss/
- Overview
- Full-featured malloc library for C and C++ providing detection of memory leaks,
use of uninitialised memory and out of range block accesses as well as lots of
tracing facilities.
- MTrace
- Author
- Morris R. Dovey (mrdovey@iedu.com)
- License
- Free Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.iedu.com/mrd/c/mtrace.c
- Overview
- A very simple malloc tracing package.
- MuForce
- Author
- Thomas Richter (thor@einstein.math.tu-berlin.de)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://www.math.tu-berlin.de/~thor/thor/index.html
- Overview
- Uses the MMU to monitor the system for any writes to non-existent memory and
reports them over the serial port or any other output stream.
- MuGuardianAngel
- Author
- Thomas Richter (thor@einstein.math.tu-berlin.de)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://www.math.tu-berlin.de/~thor/thor/index.html
- Overview
- An extension to the MuForce program which protects free memory and detects all
illegal memory accesses.
- MuLib
- Author
- Thomas Richter (thor@einstein.math.tu-berlin.de)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://www.math.tu-berlin.de/~thor/thor/index.html
- Overview
- Provides access to the MMU in modern Amigas so that features such as virtual
memory can be implemented.
- MULTI
- Author
- Green Hills Software, Inc. (sales@ghs.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.ghs.com
- Overview
- Inserts special checks into a program to watch for and report a broad variety
of run-time errors, including freeing unallocated memory and memory leaks.
- Mungwall
- Author
- Commodore-Amiga, Inc. (info@amiga.de)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://wuarchive.wustl.edu/~aminet/dirs/dev_debug.html
- Overview
- Patches the system to check for free memory corruption.
- NJAMD (Not Just Another Malloc Debugger)
- Author
- Mike Perry (mikepery@fscked.org)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http://fscked.org/proj/njamd.shtml/
- Overview
- Helps track down a wide range of memory allocation problems and is divided
into a front end executable and a library back end.
- ObjectCenter
- Author
- CenterLine Development Systems (info@centerline.com)
- License
- Commercial Software
- Platforms
- Various UNIX
- Location
- http://www.centerline.com/
- Overview
- Provides a C and C++ programming environment that can detect memory leaks,
duplicate frees and illegal access errors including loads from uninitialised
objects.
- Optimizeit
- Author
- Intuitive Systems, Inc. (info@optimizeit.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.optimizeit.com/
- Overview
- Attempts to locate memory leaks and performance bottlenecks in Java programs.
- Plumber
- Author
- Owen O'Malley (omalley@ics.uci.edu)
- License
- GNU General Public License
- Platforms
- Linux, Solaris, SunOS
- Location
- http://www.ics.uci.edu/~softtest/plumber.html
- Overview
- A tool that replaces the normal Ada and C/C++ dynamic memory allocation
functions and detects unfreed memory blocks.
- Purify
- Author
- Rational Software (info@rational.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.rational.com/
- Overview
- Uses Object Code Insertion technology to provide run-time error checking and
memory leak detection.
- QC
- Author
- Onyx Technology (sales@onyx-tech.com)
- License
- Commercial Software
- Platforms
- MacOS
- Location
- http://www.onyx-tech.com/
- Overview
- Runs in the background as a control panel and detects various memory errors
which can then be caught and run under a debugger.
- SBase
- Author
- Ben Lilburne (blilburn@cit.nepean.uws.edu.au)
- License
- Free Software
- Platforms
- Various UNIX, Windows
- Location
- http://www.cit.uws.edu.au/~blilburn/sbase/
- Overview
- A set of classes for debugging dynamic memory problems in Objective C.
- SCID
- Author
- Richard Mills (rich@xerp.freeserve.co.uk)
- License
- GNU General Public License
- Platforms
- Various UNIX
- Location
- http:///www.xerp.demon.co.uk/
- Overview
- A program that tries to help locate bugs caused by the reading and writing of
invalid pointers in C code by source code insertion.
- SmartAlloc
- Author
- John Walker
- License
- Free Software
- Platforms
- Various UNIX, MS-DOS
- Location
- http://www.fourmilab.ch/smartall/
- Overview
- Detects orphaned buffers of dynamic memory allocations and also helps to find
other common problems in management of dynamic storage.
- SmartHeap
- Author
- MicroQuill (info@microquill.com)
- License
- Commercial Software
- Platforms
- Various UNIX, Windows, OS/2, MS-DOS, MacOS
- Location
- http://www.microquill.com/
- Overview
- Provides optimised heap performance along with detecting memory leaks, memory
overwrites, double-freeing, wild pointers, invalid parameters, etc.
- Spotlight
- Author
- Onyx Technology (sales@onyx-tech.com)
- License
- Commercial Software
- Platforms
- MacOS
- Location
- http://www.onyx-tech.com/
- Overview
- Performs memory protection on PowerPC executables and helps detect memory leaks.
- StackTrace
- Author
- Bjorn Reese (breese@mail1.stofanet.dk)
- License
- Free Software
- Platforms
- Various UNIX
- Location
- http://home1.stofanet.dk/breese/debug/debug.tar.gz
- Overview
- Provides code to generate a stack trace of the program at any point during
execution using either a debugger or built-in methods found in the GNU C
compiler or on some systems.
- TestCenter
- Author
- CenterLine Development Systems (info@centerline.com)
- License
- Commercial Software
- Platforms
- Various UNIX
- Location
- http://www.centerline.com/
- Overview
- Detects memory leaks, duplicate frees and illegal access errors including loads
from uninitialised objects.
- Third Degree
- Author
- Digital Equipment Corporation (info@digital.com)
- License
- Commercial Software
- Platforms
- Digital UNIX
- Location
- http://www.digital.com/
- Overview
- A tool that performs memory access checks and memory leak detection of C, C++
and Fortran programs at run-time. Applications are modified using ATOM to
determine if any memory locations are accessed when not properly allocated or
initialised.
- Valgrind
- Author
- Julian Seward (jseward@acm.org)
- License
- GNU General Public License
- Platforms
- Linux
- Location
- http://valgrind.org/
- Overview
- A suite of tools for debugging and profiling on Linux. Implements a virtual
machine for various different processor architectures in order to perform
instrumentation on the application being debugged.
- Vmalloc
- Author
- Kiem-Phong Vo (kpv@research.att.com)
- License
- AT&T Source Code License
- Platforms
- Various UNIX, Windows
- Location
- http://akpublic.research.att.com/sw/tools/vmalloc/
- Overview
- A discipline and method library for dynamic memory allocation, with support for
regions, debugging and profiling.
- Wipeout
- Author
- Olaf Barthel (olsen@sourcery.han.de)
- License
- Free Software
- Platforms
- AmigaOS
- Location
- http://wuarchive.wustl.edu/~aminet/dirs/dev_debug.html
- Overview
- Runs in the background checking free memory for corruption.
- YaMa
- Author
- Venkatesha Murthy G. (gvmt@vsnl.com)
- License
- Free Software
- Platforms
- Linux
- Location
- http://www.geocities.com/ipsgvm/libyama/
- Overview
- A memory allocator with leak tracing and some anti-heap corruption facilities.
- YAMD (Yet Another Malloc Debugger)
- Author
- Nate Eldredge (neldredge@hmc.edu)
- License
- GNU General Public License
- Platforms
- Linux, MS-DOS
- Location
- http://www3.hmc.edu/~neldredge/yamd/
- Overview
- A tool for finding bugs related to dynamic memory allocation in C and C++, and
includes paging mechanisms to catch bugs immediately.
- ZeroFault
- Author
- The Kernel Group (info@zerofault.com)
- License
- Commercial Software
- Platforms
- AIX UNIX
- Location
- http://www.zerofault.com/
- Overview
- Uses run-time emulator technology to provide run-time error checking and memory
leak detection.
However, before you try out any of the above software, there may already be a
malloc library with debugging support on your system that might be suitable for
solving your problem. For example, on Solaris the following libraries are
available:
- malloc(3c)
- Trade-off between performance and efficiency.
- malloc(3x)
- Slower performance, space-efficient.
- bsdmalloc(3x)
- Better performance, space-inefficient.
- mtmalloc(3t)
- Thread-safe memory allocator.
- mapmalloc(3x)
- Uses
mmap()
instead of sbrk()
to allocate heap space.
- watchmalloc(3x)
- Uses watch point areas to check for overflows.
On platforms with the GNU C library, such as Linux, there are several
environment variables that can be used to enable various debugging features of
malloc()
, etc. There are also extra functions provided in the library
which can be used to aid in debugging, and some shell scripts which can
translate return addresses or locate unfreed memory allocations in the log files
produced. Useful information on the debugging features available within the
GNU C library is located at http://sdb.suse.de/sdb/en/html/aj_debug.html.
If you suspect that the debugging problem you are looking at is likely to be
related to UNIX system calls then some systems come with the strace
or truss commands which allow you to trace all of the system calls
that a program makes when running. This can sometimes be invaluable in
pinpointing the exact point at which a program fails, but as it only operates
at the system call level, no information about individual memory allocations is
available.
On Windows 2000 (and probably later releases of the operating system as well)
there is a utility called pageheap which acts in a similar way to the
mpatrol command in that it overrides the definitions of
malloc()
and related functions for any programs that it runs. It has
a similar behaviour to the --page-alloc-upper option but has far less
features. However, it could be very useful if you can't get mpatrol to work
for you.