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

UiModeManager has a memory leak in Android U #2559

Closed
vgonda opened this issue Aug 8, 2023 · 5 comments · Fixed by #2633
Closed

UiModeManager has a memory leak in Android U #2559

vgonda opened this issue Aug 8, 2023 · 5 comments · Fixed by #2633
Milestone

Comments

@vgonda
Copy link

vgonda commented Aug 8, 2023

Reported here: https://issuetracker.google.com/issues/294776102

Found while leak hunting with @joshskeen @helios175 @rjrjr And whoever else was on the call that I couldn't see.

LeakTrace information

┬─── 
│ GC Root: Global variable in native code 
│ 
├─ android.app.UiModeManager$1 instance 
│    Leaking: UNKNOWN 
│    Retaining 2.2 MB in 64692 objects 
│    Anonymous subclass of android.app.IUiModeManagerCallback$Stub 
│    ↓ UiModeManager$1.this$0 
│                      ~~~~~~ 
├─ android.app.UiModeManager instance 
│    Leaking: UNKNOWN 
│    Retaining 2.2 MB in 64691 objects 
│    mContext instance of com.squareup.ui.main.MainActivity with mDestroyed = true 
│    ↓ UiModeManager.mContext 
│                    ~~~~~~~~
╰→ com.squareup.ui.main.MainActivity instance
 ​     Leaking: YES (ObjectWatcher was watching this because com.squareup.ui.main.MainActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
 ​     Retaining 2.2 MB in 64679 objects
 ​     key = dd32c85b-75ee-4127-b524-ae5bf267ab8a
 ​     watchDurationMillis = 58277
 ​     retainedDurationMillis = 53277
 ​     mApplication instance of com.squareup.development.SposDevApp
 ​     mBase instance of androidx.appcompat.view.ContextThemeWrapper
--

@juliocbcotta
Copy link

@pyricau could we get a new release of Leak Canary with the ignored new leaks? I think one is a good candidate to be added.

@pyricau
Copy link
Member

pyricau commented Jan 2, 2024

@pyricau
Copy link
Member

pyricau commented Jan 2, 2024

could we get a new release of Leak Canary with the ignored new leaks?

Probably not on 2.x, as I'd rather focus my limited time on 3.x. But 3.x will likely be released as non stable alpha for a while.

Until then, you can easily create & maintain your own list of ignored leaks in your apps.

@hp902
Copy link

hp902 commented Feb 13, 2024

@pyricau Is this fixed in 3.0-alpha-1?

@pyricau
Copy link
Member

pyricau commented Feb 17, 2024

@hp902 no this will be fixed in the next release. You can add it manually to your config for now.

@pyricau pyricau modified the milestones: 3.0, 2.14 Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants