adyen-android icon indicating copy to clipboard operation
adyen-android copied to clipboard

[v5.2.0] DropInActivity leak

Open wrozwad opened this issue 1 year ago • 1 comments

FYI, it happens after every payment I make.

====================================
HEAP ANALYSIS RESULT
====================================
1 APPLICATION LEAKS

References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.

83354 bytes retained by leaking objects
Signature: 544afc1f884db8f789eeaaf7efc86008be34a837
┬───
│ GC Root: System class
│
├─ android.provider.FontsContract class
│    Leaking: NO (CheckoutExampleApplication↓ is not leaking and a class is never leaking)
│    ↓ static FontsContract.sContext
├─ com.adyen.checkout.example.CheckoutExampleApplication instance
│    Leaking: NO (Application is a singleton)
│    mBase instance of android.app.ContextImpl
│    ↓ Application.mLoadedApk
│                  ~~~~~~~~~~
├─ android.app.LoadedApk instance
│    Leaking: UNKNOWN
│    Retaining 289,4 kB in 6108 objects
│    mApplication instance of com.adyen.checkout.example.CheckoutExampleApplication
│    Receivers
│    ..CheckoutExampleApplication@326416312
│    ....VisibilityTracker@330625904
│    ↓ LoadedApk.mServices
│                ~~~~~~~~~
├─ android.util.ArrayMap instance
│    Leaking: UNKNOWN
│    Retaining 288,2 kB in 6085 objects
│    ↓ ArrayMap.mArray
│               ~~~~~~
├─ java.lang.Object[] array
│    Leaking: UNKNOWN
│    Retaining 288,2 kB in 6083 objects
│    ↓ Object[2]
│            ~~~
├─ android.app.ContextImpl instance
│    Leaking: UNKNOWN
│    Retaining 6,2 kB in 86 objects
│    mOuterContext instance of android.app.ContextImpl
│    ContextImpl.mOuterContext == ContextImpl.this: not tied to any particular lifecycle
│    ↓ ContextImpl.mAutofillClient
│                  ~~~~~~~~~~~~~~~
├─ android.view.autofill.AutofillClientController instance
│    Leaking: UNKNOWN
│    Retaining 26 B in 1 objects
│    mActivity instance of com.adyen.checkout.dropin.internal.ui.DropInActivity with mDestroyed = true
│    ↓ AutofillClientController.mActivity
│                               ~~~~~~~~~
╰→ com.adyen.checkout.dropin.internal.ui.DropInActivity instance
     Leaking: YES (ObjectWatcher was watching this because com.adyen.checkout.dropin.internal.ui.DropInActivity
     received Activity#onDestroy() callback and Activity#mDestroyed is true)
     Retaining 83,4 kB in 1874 objects
     key = 1587ed95-8206-4732-836c-4946f556d3d8
     watchDurationMillis = 17792
     retainedDurationMillis = 12792
     dropInService instance of com.adyen.checkout.example.service.ExampleAdvancedDropInService
     mApplication instance of com.adyen.checkout.example.CheckoutExampleApplication
     mBase instance of androidx.appcompat.view.ContextThemeWrapper
====================================
0 LIBRARY LEAKS

A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
====================================
0 UNREACHABLE OBJECTS

An unreachable object is still in memory but LeakCanary could not find a strong reference path
from GC roots.
====================================
METADATA

Please include this in bug reports and Stack Overflow questions.

Build.VERSION.SDK_INT: 34
Build.MANUFACTURER: Google
LeakCanary version: 2.12
App process name: com.adyen.checkout.example
Class count: 32785
Instance count: 319337
Primitive array count: 171229
Object array count: 44411
Thread count: 44
Heap total bytes: 35818871
Bitmap count: 29
Bitmap total bytes: 1039589
Large bitmap count: 0
Large bitmap total bytes: 0
Stats: LruCache[maxSize=3000,hits=137407,misses=288672,hitRate=32%]
RandomAccess[bytes=14351537,reads=288672,travel=98424778666,range=43823735,size=53537679]
Heap dump reason: 8 retained objects, app is visible
Analysis duration: 10462 ms
Heap dump file path: /storage/emulated/0/Download/leakcanary-com.adyen.checkout.example/2024-03-12_11-45-34_397.hprof
Heap dump timestamp: 1710240348056
11:45:48.095  D  Heap dump duration: 1409 ms
====================================

wrozwad avatar Mar 12 '24 11:03 wrozwad

@wrozwad thanks for reporting this. We've seen it as well but we're still investigating why it happens and what is the impact. We'll update you when we have a fix.

jreij avatar Mar 12 '24 12:03 jreij

@wrozwad 5.4.0 was just released. It contains a few memory leak fixes including this one.

OscarSpruit avatar May 30 '24 13:05 OscarSpruit