android / android/identity-samples
Memory Leak: PasskeySettingsActivity
- Dominant language
- Kotlin
- Stars
- 515
- Forks
- 283
- Avg merge
- 9h 37m
- Merged PRs (30d)
- 2
Description
┬───
│ GC Root: Global variable in native code
│
├─ android.os.ResultReceiver$MyResultReceiver instance
│ Leaking: UNKNOWN
│ Retaining 4.4 kB in 47 objects
│ ↓ ResultReceiver$MyResultReceiver.this$0
│ ~~~~~~
├─ androidx.credentials.playservices.controllers.CreatePublicKeyCredential.
│ CredentialProviderCreatePublicKeyCredentialController$resultReceiver$1
│ instance
│ Leaking: UNKNOWN
│ Retaining 1.4 kB in 46 objects
│ Anonymous subclass of android.os.ResultReceiver
│ ↓ CredentialProviderCreatePublicKeyCredentialController$resultReceiver$1.
│ this$0
│ ~~~~~~
├─ androidx.credentials.playservices.controllers.CreatePublicKeyCredential.
│ CredentialProviderCreatePublicKeyCredentialController instance
│ Leaking: UNKNOWN
│ Retaining 1.3 kB in 44 objects
│ context instance of com.linkdokter.halodoc.android.more.presentation.ui.
│ PasskeySettingsActivity with mDestroyed = true
│ ↓ CredentialProviderCreatePublicKeyCredentialController.context
│ ~~~~~~~
╰→ com.linkdokter.halodoc.android.more.presentation.ui.PasskeySettingsActivity
instance
Leaking: YES (ObjectWatcher was watching this because com.linkdokter.
halodoc.android.more.presentation.ui.PasskeySettingsActivity received
Activity#onDestroy() callback and Activity#mDestroyed is true)
Retaining 1.7 MB in 11837 objects
key = 2a2848ea-44d3-4942-9c31-a58b7bcc2e0e
watchDurationMillis = 42473
retainedDurationMillis = 37471
mApplication instance of com.linkdokter.halodoc.android.HaloDocApplication
mBase instance of androidx.appcompat.view.ContextThemeWrapper
METADATA
Build.VERSION.SDK_INT: 30
Build.MANUFACTURER: Realme
LeakCanary version: 2.14
App process name: com.linkdokter.halodoc.android.stage
Class count: 45599
Instance count: 470147
Primitive array count: 258244
Object array count: 74867
Thread count: 220
Heap total bytes: 59757223
Bitmap count: 69
Bitmap total bytes: 12394073
Large bitmap count: 0
Large bitmap total bytes: 0
Db 1: open /data/user/0/com.linkdokter.halodoc.android.stage/databases/com.
google.android.datatransport.events
Db 2: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 3: open /data/user/0/com.linkdokter.halodoc.android.stage/databases/app_db
Db 4: open /data/user/0/com.linkdokter.halodoc.android.stage/no_backup/androidx.
work.workdb
Db 5: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/mqttAndroidService.db
Db 6: open /data/user/0/com.linkdokter.halodoc.android.stage/databases/nudge_db
Db 7: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/apotikantar_db
Db 8: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/tc_database
Db 9: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/patient_db
Db 10: open /data/user/0/com.linkdokter.halodoc.android.stage/databases/qiscus.
db
Db 11: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/insurance_db
Db 12: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/lab_service_db
Db 13: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/clevertap
Db 14: open /data/user/0/com.linkdokter.halodoc.android.stage/databases/chucker.
db
Db 15: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/reminder.db
Db 16: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/recent_search_db
Db 17: open /data/user/0/com.linkdokter.halodoc.android.
stage/databases/micro_app_db
Db 18: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 19: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 20: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 21: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 22: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 23: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 24: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 25: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 26: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 27: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Db 28: closed /data/user/0/com.linkdokter.halodoc.android.
stage/databases/google_app_measurement_local.db
Count of retained yet cleared: 11 KeyedWeakReference instances
Stats: LruCache[maxSize=3000,hits=116905,misses=396079,hitRate=22%]
RandomAccess[bytes=20858034,reads=396079,travel=250368202488,range=64828691,size
=82648203]
Analysis duration: 35236 ms
Contributor guide
Research direction
Start by locating PasskeySettingsActivity and tracing its passkey creation flow through CreatePublicKeyCredentialController and its ResultReceiver. Reproduce the LeakCanary report on the listed Android configuration, then verify that destroying the activity no longer retains it through the credential controller.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100