Memory introspection

Doug Lea's dlmalloc page, which is very interesting, is at:

   http://g.oswego.edu/dl/html/malloc.html

libdlmalloc is the default memory allocator for most Linux distributions at this time.


Phil Ehrens makes available at http://www.imbe.net/dlmalloc_tcl.tar.bz2 "a thread safe version of dlmalloc which also exposes a couple of useful functions at the tcl layer so you can watch it work". http://www.phaseit.net/claird/comp.lang.tcl/binaries/dlmalloc_tcl.tar.bz2 mirrors it.

PSE- This library is being used to handle the memory allocation on all of our Solaris systems (up to 8 cpu's) and is stable and works exactly as advertised.

All of our production Linux systems are, for better or worse, running RedHat 7.1, and this distro uses it's own thread-patched version of libdlmalloc for ALL memory alocation.


Tcl itself provides memory introspection through the memory command. This command will be enabled only if Tcl was compiled with the MEM_DEBUG preprocessor flag defined (-DMEM_DEBUG).


A commercial tool for memory introspection and checking is Purify:

  http://www.rational.com/products/purify_unix/index.jsp
  http://www.rational.com/products/purify_nt/index.jsp

Purify does not and never will support GCC*

A commercial tool for memory introspection and checking that DOES support gcc, and works very well, is Insure:

  http://www.parasoft.com/products/insure/index.htm

AMG: (*) Really? Here [L1 ] is a mention of Purify supporting 32-bit gcc 3.1 on HP/UX.


An open source memory checker: Electric Fence

   http://freshmeat.net/projects/efence

Which is now under the new name DUMA

   http://duma.sourceforge.net.

C++ Heap Map : A small malloc() and free() interceptor library (heaptrace.so, 45 lines of C++) and minimalistic Tcl/Tk GUI for visual C++ heap analysis — a powerful tool for disputes settlement and curiosity satisfaction.

https://web.archive.org/web/20170109113605im_/bobah.net/sites/default/files/images/heapmap.tk_.zoom_.png