facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.25k stars 950 forks source link

Memory Leak in Android Flipper library #5604

Open juzha opened 1 month ago

juzha commented 1 month ago

🐛 Bug Report

┬─── │ GC Root: Thread object │ ├─ WV.kd instance │ Leaking: NO (PathClassLoader↓ is not leaking) │ Thread name: 'CleanupReference' │ ↓ Thread.contextClassLoader ├─ dalvik.system.PathClassLoader instance │ Leaking: NO (ApplicationDescriptor↓ is not leaking and A ClassLoader is never leaking) │ ↓ ClassLoader.runtimeInternalObjects ├─ java.lang.Object[] array │ Leaking: NO (ApplicationDescriptor↓ is not leaking) │ ↓ Object[6631] ├─ com.facebook.flipper.plugins.inspector.descriptors.ApplicationDescriptor class │ Leaking: NO (a class is never leaking) │ Library leak match: static field com.facebook.flipper.plugins.inspector.descriptors.ApplicationDescriptor#editedDelegates │ ↓ static ApplicationDescriptor.editedDelegates │ ~~~ ├─ java.util.ArrayList instance │ Leaking: UNKNOWN │ Retaining 2.5 MB in 54013 objects │ ↓ ArrayList[3] │ ~~~ ╰→ com.android.internal.policy.DecorView instance ​ Leaking: YES (ObjectWatcher was watching this because com.android.internal.policy.DecorView received View#onDetachedFromWindow() callback and View.mContext references a destroyed activity) ​ Retaining 2.5 MB in 54011 objects ​ key = 4fe388c0-f2b2-460a-aba6-181bb0c237d8 ​ watchDurationMillis = 5914 ​ retainedDurationMillis = 914 ​ View not part of a window view hierarchy ​ View.mAttachInfo is null (view detached) ​ View.mWindowAttachCount = 1 ​ mContext instance of com.android.internal.policy.DecorContext, wrapping activity com..MY_COMPANY.android.SOMEActivity with mDestroyed = true

To Reproduce

I integrated LeakCanary in the app and try to find memory leaks of my app and triggered this link for Flipper plugin.

Environment

Android 13 Android flipper library: "0.247.0" Flipper Desktop Version 0.252.0