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

FacebookMediationAdapter Memory Leak #531

Open
xiaojianli opened this issue Sep 5, 2024 · 0 comments
Open

FacebookMediationAdapter Memory Leak #531

xiaojianli opened this issue Sep 5, 2024 · 0 comments

Comments

@xiaojianli
Copy link

We found a memory leak in FacebookMediationAdapter. The log is as follows:

2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ android.animation.PropertyValuesHolder class
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: NO (Qh↓ is not leaking and a class is never leaking)
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ static PropertyValuesHolder.sGetterPropertyMap
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ java.util.HashMap instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: NO (Qh↓ is not leaking)
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ HashMap[key()]
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.Qh class
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: NO (DexClassLoader↓ is not leaking and a class is never leaking)
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ static Qh.$class$classLoader
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ dalvik.system.DexClassLoader instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: NO (2o↓ is not leaking and A ClassLoader is never leaking)
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ ClassLoader.runtimeInternalObjects
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ java.lang.Object[] array
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: NO (2o↓ is not leaking)
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ Object[934]
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.2o class
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: NO (a class is never leaking)
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ static 2o.A05
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │                ~~~
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.2o instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Retaining 7.0 MB in 66856 objects
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    A00 instance of com.eff.notepad.NotepadApplication
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ 2o.A04
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ java.util.HashMap instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Retaining 1.1 kB in 62 objects
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ HashMap[key()]
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │             ~~~~~~~
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.16 instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Retaining 1.3 MB in 18214 objects
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    A02 instance of com.facebook.ads.redexgen.X.Yn, wrapping com.eff.notepad.NotepadApplication
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ 16.A01
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.ai instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Retaining 32.5 kB in 433 objects
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    ↓ ai.A04
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.FO instance
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    Retaining 23.9 kB in 159 objects
2024-09-05 16:42:17.949 20960-22967 LeakCanary               AA   D  │    A0B instance of com.facebook.ads.redexgen.X.Yn, wrapping com.eff.notepad.NotepadApplication
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    ↓ am.A06
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.VC instance
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Retaining 12 B in 1 objects
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    ↓ VC.A00
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.V2 instance
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Retaining 1.2 MB in 17468 objects
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    A0c instance of com.facebook.ads.redexgen.X.Yn, wrapping com.eff.notepad.NotepadApplication
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    ↓ V2.A0f
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ├─ com.facebook.ads.redexgen.X.Lg instance
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Leaking: UNKNOWN
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Retaining 911.8 kB in 15323 objects
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    ↓ Lg.A0F
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │         ~~~
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ├─ com.eff.notepad.views.ThemeBackgroundButton instance
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Leaking: YES (View.mContext references a destroyed activity)
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    Retaining 911.8 kB in 15322 objects
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    View not part of a window view hierarchy
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    View.mAttachInfo is null (view detached)
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    View.mID = R.id.ad_action_spread
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    View.mWindowAttachCount = 1
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    mContext instance of com.eff.notepad.home.HomeActivity with mDestroyed = true
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  │    ↓ View.mContext
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ╰→ com.eff.notepad.home.HomeActivity instance
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     Leaking: YES (ObjectWatcher was watching this because com.eff.notepad.home.HomeActivity received
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     Activity#onDestroy() callback and Activity#mDestroyed is true)
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     Retaining 853.6 kB in 14315 objects
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     key = c3f800cf-b524-420b-80ab-829d26c97297
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     watchDurationMillis = 5396
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     retainedDurationMillis = 396
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     mApplication instance of com.eff.notepad.NotepadApplication
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ​     mBase instance of androidx.appcompat.view.ContextThemeWrapper
2024-09-05 16:42:17.950 20960-22967 LeakCanary               AA   D  ====================================

In the code of 'com.google.ads.mediation:facebook:6.17.0.0', I didn't find any place to call the destory method of Facebook Native Ad. I don't know if it is related to this.

Also, we are displaying ads in a RecyclerView.

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

1 participant