1) Is there also any memory leak tool called Boehmgc? How is that tool compared to others?
2) I have used LeakTracer, mudflap and Valgrind. But unfortunately LeakTracer has the disadvantage of memory hogging (pooling a lot of memory at start and then allocating it), so what are the alternatives?
Boehm GC is a garbage collector, similar to the garbage collection in Java. The other tools you mention are designed to warn you about leaks, such that you can take corrective action. Garbage collection is designed to find and recover no-longer used allocations, as the program runs. Example (from wikipedia page):
Personally there’s something about using garbage collection in C or C++ that makes me quite uneasy. For C++ “Smart pointers” are the way to go in my opinion in scenarios where ownership is unclear (although you might want to have a thing about why it’s unclear in your design) and for help with exception safety (E.g. what the now deprecated
std::auto_ptrwas designed for)As for the leak detectors you can add:
To your list of Linux ones.
Related memory checking tools, but not leaks: