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

Clarify what "excluded leaks" are about #1079

Closed
pyricau opened this issue Aug 3, 2018 · 4 comments
Closed

Clarify what "excluded leaks" are about #1079

pyricau opened this issue Aug 3, 2018 · 4 comments
Milestone

Comments

@pyricau
Copy link
Member

pyricau commented Aug 3, 2018

Developers new to LeakCanary are sometimes surprised by what "excluded" means, it's not immediately obvious, and they don't know what to do with it.

There's probably some tiny adjustments we can make to UX / messaging to clarify.

@mateusgrb
Copy link

what does it mean by the way?
I made some changes to fix a memory leak and started getting them after. If they are excluded, why are they displayed?
device-2018-09-06-110702

@pyricau
Copy link
Member Author

pyricau commented Oct 15, 2018

Generally, all leaks are real leaks. However, some leaks happen in the Android source code, and there isn't much we can do to fix them except wait for a new Android version that doesn't have the leak.

LeakCanary lets you set a list of exclusions. If a leak trace matches one of those exclusions, it gets marked as "excluded", which means you can safely ignore it (if, and only if, you wrote exclusions correctly). The way I think of it: "this leak is something that I can't do anything about, so I don't have to pay attention to it"

However, LeakCanary can only detect if a leak is "excluded" after it runs the analysis, which means that even when you ignore a leak you'll still get the VM to freeze and the notification about the analysis. So there's still a cost to it in dev, and it's better to find a way to fix the leak if you can. Initially we were hidden the excluded leaks but then people would complain that they'd see the VM freeze and couldn't find the leak afterwards.

If you've got several activities / fragment matching an exclusion that you added, you should double check that this isn't an actual real leak in app code.

@pyricau
Copy link
Member Author

pyricau commented Jan 10, 2019

I filed this issue twice, so closing the other and copy pasting here what I wrote:

Developers typically aren't sure what to do with excluded leaks, so we should think about better ways (in notifications / leak string / leak UI) to convey what this is / what to do.

Typically they can:

Ignore those
Use a more recent Android version
Figure out a hacky way to make the leak go away

@pyricau
Copy link
Member Author

pyricau commented May 5, 2019

We've changed the words, instead of "excluded" these are known as "won't fix". I believe this will better convey that those are indeed leaks.

@pyricau pyricau closed this as completed May 5, 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

2 participants