Memory Fragmentation Profiler

Andrew picture Andrew · Sep 6, 2009 · Viewed 9k times · Source

Are there any good memory fragmentation profilers? (linux gcc version would be nice). Valgrind cannot analyze this because it uses custom malloc/free functions.

Thanks, Andrew

Answer

Martin v. Löwis picture Martin v. Löwis · Sep 7, 2009

I would start with mtrace. When you have a trace, glibc comes with a perl script mtrace(1) which finds leaks. However, the trace format is easy to understand, so it should be straight-forward process this into fragmentation analysis.