[lttng-dev] Simple and fast memleak finder

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Fri Jun 14 17:16:26 EDT 2013


Hi,

A few words to let you know that I just created a simple, yet efficient,
memory leak finder library: memleak-finder.so. It's been useful to find
some nasty memory leaks in the current LTTng development cycle, and it's
generic enough to be used by other projects. It can pinpoint memory
leaks that can only be reproduced in stress-tests, where valgrind has
too much overhead.

Example output:

[leak] ptr: 0x18b2350 size: 0x160 caller: 0x7fae7943e28f <symbol>

There is also another very simple shared object (malloc-stats.so) that
will print the malloc_stats(3) of a program when receiving SIGUSR2, for
instance:

Arena 0:
system bytes     =     135168
in use bytes     =      19360
Total (incl. mmap):
system bytes     =     135168
in use bytes     =      19360
max mmap regions =          0
max mmap bytes   =          0

The code is available at:
git://github.com/efficios/memleak-finder.git

See the README file for more info.

Enjoy!

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list