Doug Lea's dlmalloc page, which is very interesting, is at:
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:
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:
An open source memory checker: Electric Fence
Which is now under the new name DUMA
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.