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

Leak in GleapInvisibleActivityManager #13

Open
ggueno opened this issue May 7, 2024 · 0 comments
Open

Leak in GleapInvisibleActivityManager #13

ggueno opened this issue May 7, 2024 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@ggueno
Copy link

ggueno commented May 7, 2024

I found a memory leak associated with GleapInvisibleActivityManager leading to the main activity of the app being retained because a reference to the view is kept in GleapInvisibleActivityManager (from what I understand)

Here is a project I made to reproduce it (with leak canary)
gleap-leak.zip

I'm using the last version of Gleap SDK - 13.6.1

┬───
│ GC Root: Thread object
│
├─ WV.kc instance
│    Leaking: NO (PathClassLoader↓ is not leaking)
│    Thread name: 'CleanupReference'
│    ↓ Thread.contextClassLoader
├─ dalvik.system.PathClassLoader instance
│    Leaking: NO (GleapInvisibleActivityManger↓ is not leaking and A
│    ClassLoader is never leaking)
│    ↓ ClassLoader.runtimeInternalObjects
├─ java.lang.Object[] array
│    Leaking: NO (GleapInvisibleActivityManger↓ is not leaking)
│    ↓ Object[774]
├─ io.gleap.GleapInvisibleActivityManger class
│    Leaking: NO (a class is never leaking)
│    ↓ static GleapInvisibleActivityManger.instance
│                                          ~~~~~~~~
├─ io.gleap.GleapInvisibleActivityManger instance
│    Leaking: UNKNOWN
│    Retaining 1.3 MB in 3723 objects
│    ↓ GleapInvisibleActivityManger.feedbackButtonRelativeLayout
│                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
├─ androidx.constraintlayout.widget.ConstraintLayout instance
│    Leaking: YES (View.mContext references a destroyed activity)
│    Retaining 1.8 kB in 21 objects
│    View is part of a window view hierarchy
│    View.mAttachInfo is null (view detached)
│    View.mID = R.id.null
│    View.mWindowAttachCount = 1
│    mContext instance of com.capp.myapplication.MainActivity with mDestroyed =
│    true
│    ↓ View.mContext
╰→ com.capp.myapplication.MainActivity instance
​     Leaking: YES (ObjectWatcher was watching this because com.capp.
​     myapplication.MainActivity received Activity#onDestroy() callback and
​     Activity#mDestroyed is true)
​     Retaining 33.5 kB in 865 objects
​     key = 61fed3c3-d8cd-4c14-a794-d0aa1898eede
​     watchDurationMillis = 5138
​     retainedDurationMillis = 138
​     mApplication instance of com.capp.myapplication.MainApplication
​     mBase instance of androidx.appcompat.view.ContextThemeWrapper

METADATA

Build.VERSION.SDK_INT: 34
Build.MANUFACTURER: Google
LeakCanary version: 2.14
App process name: com.capp.myapplication
Class count: 28748
Instance count: 213725
Primitive array count: 153429
Object array count: 31070
Thread count: 41
Heap total bytes: 29189282
Bitmap count: 8
Bitmap total bytes: 11263984
Large bitmap count: 0
Large bitmap total bytes: 0
Count of retained yet cleared: 10 KeyedWeakReference instances
Stats: LruCache[maxSize=3000,hits=116840,misses=203573,hitRate=36%]
RandomAccess[bytes=10023503,reads=203573,travel=67669679167,range=35049901,size=
43978664]
Analysis duration: 36686 ms
@boehlerlukas boehlerlukas self-assigned this Jun 16, 2024
@boehlerlukas boehlerlukas added the good first issue Good for newcomers label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants