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

Some Activity leaks are not found #8

Closed
yoavst opened this issue May 9, 2015 · 5 comments
Closed

Some Activity leaks are not found #8

yoavst opened this issue May 9, 2015 · 5 comments

Comments

@yoavst
Copy link

yoavst commented May 9, 2015

I've got a an activity with barcode scanner. When I exit with finish(), the memory usage stay the same.
image

So it is probably a memory leak with the context.

@pyricau
Copy link
Member

pyricau commented May 9, 2015

If you used LeakCanary.install(), then in ICS+ any activity that's leaking after being destroyed will be detected. There's no way around it.

However, we sometimes ignore some leaks if they are known Android problems. Can you open logcat and see if a heap dump gets triggered? If yes, then you should at some point see a log indicating the result of the analysis. Please paste it here.

Another explanation could be that something else is leaking, ie not an activity but another set of objects that's using all the memory.

Do you have a sample project that reproduces that systematically?

@yoavst
Copy link
Author

yoavst commented May 9, 2015

Thank you for your explain. Does GC get triggered only if memory is needed, or one per time?

@pyricau
Copy link
Member

pyricau commented May 9, 2015

LeakCanary triggers the GC if an object that should be gone isn't gone yet.

@yoavst
Copy link
Author

yoavst commented May 9, 2015

Because when I trigger gc it free something like 40mb, but GC isn't triggered normally on my app.

@pyricau
Copy link
Member

pyricau commented May 9, 2015

Well then you might not have a memory leak :) . The GC is triggered when there's a need for memory. Because doing a GC is costly, Android tries to limit the number of GC.

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