-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Leak in AccountManager$AmsTask #97
Comments
Hi, Can you provide the output of the same leak report with 1.3.1-SNAPSHOT? https://github.com/square/leakcanary/blob/master/CHANGELOG.md#version-131-snapshot |
|
Looks like another case of native code holding on to a binder object (here |
and what does it mean? is it problem in framework or in my project? |
Likely AOSP. We'd need to figure out what causes that bug. |
Anonymous inner class uses the STRONG reference of parent class. |
in my case anonymous class extends android.accounts.AccountManager$AmsTask located not in activity but in singletone utils class AuthManager. and AuthManager doesnt saves reference to activity in any place |
The problem here is that there's another process that seems to hold So the question here becomes: why is the other process not done yet with |
i found a duplicate of this issue |
Filed in AOSP: https://code.google.com/p/android/issues/detail?id=173689 You can prevent this leak from happening by passing a null activity reference to the AccountManager methods, and then dealing with the returned future to to get the result and correctly start an activity when it's available. |
Ignore AccountManager leak. Fixes #97
Ignore AccountManager leak. Fixes square#97
@pyricau I tried your solution to avoid memory leak, namely, passed a null activity reference to the Your fix is for
This alert is displayed only that the activity is closed after retrieving the auth token. |
The problem still exists in N. |
have a try with this method. use
|
I've just gotten this again on an O device. |
@vanniktech please provide the leak trace and open a separate issue linking to this one. |
Sure thing. Opened #1042 |
and on all other tested devices with 4.4 or 5.x
AmsTask required and keeps reference to Activity.
The text was updated successfully, but these errors were encountered: