Penguin

A malloc(3) debugger library written by Paul Nettle who writes for http://www.flipcode.com. Quite useful and featureful, works well for both C and C++. A download link can be found here.

It works on both WIN32 and gcc/unix platforms (although I had to comment out a line that did #include "stdafx.h", which appears to be some windows-specific header).

Basically, you include the mmgr.h header file after standard includes and before your own program's include headers, and then link against the mmgr.o. Running your executable will create a "memleaks.log" file in your current working directory.

I used MMGR in a medium sized C++ project; it was around 10,000 lines not including external libraries (of which there were many). It found all the memory leaks which were leading to quite a memory hungry program. This library might be an option for platforms Valgrind is not available on -- SamJansen