leakcanary icon indicating copy to clipboard operation
leakcanary copied to clipboard

Add stacktrace for java local as gc root

Open pyricau opened this issue 4 years ago • 1 comments

When a java local is a gc root then it can be hard to understand the leak as we don't know what the stack looks like (android dumps don't include it)

One option is to capture a dump of all thread stacks right before heap dump, store that statically (and clear right after) and read this in the objects inspector to add the right stack to any java thread decorated.

One tricky bit will be ensuring that rendering of multi line labels look right.

pyricau avatar Jun 21 '21 06:06 pyricau

Another possible way to do this would be to not store the stacktrace statically but instead transform the heapdump to put in stacktraces in the standard heap dump format. More portable, though easy to get wrong.

pyricau avatar Jun 21 '21 07:06 pyricau