M-Cork - Memory Leak Debugging Tool


I'll try to update this page later, but for now, see the Sourceforge M-Cork Project Page instead. This page should redirect you there after ~15 seconds.

This project is intended as a drop in replacement for the standard malloc library, primarily for finding and "corking" memory leaks.

This project was created in 1999 after I found that dmalloc's allocation history was insufficient for my needs.   M-Cork is intended primarily to address memory leaks, although it has a memory scanning feature that can be used to detect memory buffer overflow and underflow problems after they occur.

It represents two advantages over dmalloc -- and these were the motivating factors for the creation of M-Cork:

However, it is not as old, nor necessarily as code-mature as dmalloc.   It's handy, easy to use, and works very well for the class of problems for which it is intended.

Regards,
MarvinT

Footnotes:

1   Thus, the program/programmer need not release every block of memory that the daemon allocated at start up; in my case that was in the hundreds of allocations. Admittedly this is a bit sloppy, but the timeline was very, very tight and not all allocations were in code to which I had access. Your experiences may be the same!
2   If you have utility classes or functions that do the actual allocation, M-Cork will show the location of the code that called the utility class, allowing meaningful debugging. This is controlled by the value of NSF ( Number of Stack Frames), you can either add "NSF=8" (for example) onto the configure command line, or set the environment variable NSF before running configure .