Leaked memory Flamegraph

Breno GuimarĂ£es brenorg at gmail.com
Tue Aug 15 17:27:39 UTC 2017


Hi everybody,

First of all, thanks for this awesome tool. I work with a software that may
use dozens of GB and Heaptrack is being able to nicely handle that kind of
usage. (We have use cases that go over hundreds of GB, that I will try this
week...fingers crossed!)

So, for the suggestion.

I work with an old environment and a bit out of my control, so I haven't
been able to configure heaptrack_gui. But I've been able to extract
relevant data, by changing heaptrack_print a bit.

I wanted to see the memory profile after a data structure is built in my
software. The allocation flamegraph was not good, because many of the
allocations were temporary, and they are not relevant to me.

I changed heaptrack_print to only consider leaked allocations, and print
them by bytes and not number of  allocations.

Then, my use is to run my program, and attach heaptrack right before the
data structure starts to be built. After it's done, I kill my program
leaving it no room for deallocating the data structure.
heaptrack will see that as leaked memory, and using heaptrack_print
-flamegraph (modified to print leaks), I've been able to see what parts of
the data structure were consuming more memory, by looking at which stacks
allocated more data.

What do you think about a modifier switch to let the flamegraph display
only leaked memory? That could be useful in the actual leak scenario as
well, so people could visualize detect what is leaking most in their
software.

I'd be willing to write that code, btw. It would be just a matter of adding
the switch and choosing what to print.

Thanks,
Breno Rodrigues GuimarĂ£es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/heaptrack/attachments/20170815/358521f0/attachment.html>


More information about the Heaptrack mailing list