Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group leaks by identified possible causes #1202

Closed
pyricau opened this issue Mar 18, 2019 · 6 comments
Closed

Group leaks by identified possible causes #1202

pyricau opened this issue Mar 18, 2019 · 6 comments
Milestone

Comments

@pyricau
Copy link
Member

pyricau commented Mar 18, 2019

What matters when investigating leaks is not what we're leaking or what the gc root is, but what the possible causes are. Experience has shown that the same leak can lead to an activity, a fragment, or a view leaking. We can use the new reachability data to use the parts of the leak trace that are identified are possible cause as a grouping hash.

This is showing promising results internally at Square for remote reporting and grouping.

We should also group together all leaks excluded by the same exclusion.

@pyricau
Copy link
Member Author

pyricau commented Mar 18, 2019

Also worth grouping compiled lambdas (which name change with each compile run). Need to build a list of examples:

-$$Lambda$AuthSpinnerPresenter$snvjCTOjLXo0XgGesrxzMmo4a_g.f$0

@pyricau pyricau added this to the 2.0 milestone Mar 19, 2019
@pyricau
Copy link
Member Author

pyricau commented Mar 29, 2019

We've got an interesting edge case when it comes to grouping: different parts of the hashmap implementation pointing to the same object lead to different leak traces. Leak Canary picks any of the shortests paths. Makes we wonder if we should sort those and pick the first, to have more consistent results and grouping.

@pyricau
Copy link
Member Author

pyricau commented Mar 30, 2019

Need to update the UI to display leak groups first, then you open one group and see the group summary (ie subpart of leak trace) and a list of all instances and then you can dive in on any of those and you'll see a full leak trace.

@pyricau pyricau mentioned this issue Mar 30, 2019
@pyricau
Copy link
Member Author

pyricau commented Mar 30, 2019

Also we will need to fix #1209

@pyricau
Copy link
Member Author

pyricau commented Mar 30, 2019

  • Update storage
    • The current heapdump and all analysis result are stored in the main app.
    • One root leakcanary directory
    • Stores only one heapdump, the heapdump in progress, deleted or moved immediately after analysis
    • In it, one folder for each analysis
    • In there, one file for each leaktrace. Each file has the hash of the trace causes as a prefix, which allows us to create groups with counts by just scanning the fs without reading any content. Still unclear: how do we represent such a group visually? We have counts that's all.aybe a tag for excluded leaks, not normal ones.

@pyricau
Copy link
Member Author

pyricau commented Apr 13, 2019

This is done, although we need to polish the UI some more.

@pyricau pyricau closed this as completed Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant