infinum / Android-Goldfinger

Android library to simplify Biometric authentication implementation.
Apache License 2.0
653 stars 73 forks source link

Memory leaks #65

Closed ShurikuS57 closed 4 years ago

ShurikuS57 commented 4 years ago

goldfinger ver. 2.0.0 Leaks showed after close screen. Examples from this project showed current leak too.

====================================
HEAP ANALYSIS RESULT
====================================
2 APPLICATION LEAKS

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

224967 bytes retained by leaking objects
Signature: f8189514bec15af85b141c7885014b11ee1a31e
┬───
│ GC Root: Global variable in native code
│
├─ android.hardware.biometrics.BiometricPrompt$1 instance
│    Leaking: UNKNOWN
│    Anonymous subclass of android.hardware.biometrics.IBiometricServiceReceiver$Stub
│    ↓ BiometricPrompt$1.this$0
│                        ~~~~~~
├─ android.hardware.biometrics.BiometricPrompt instance
│    Leaking: UNKNOWN
│    ↓ BiometricPrompt.mContext
│                      ~~~~~~~~
╰→ ru.mc2soft.lk.presentation.mvp.authorization.pincode.PinCodeActivity instance
      Leaking: YES (ObjectWatcher was watching this because ru.mc2soft.lk.presentation.mvp.authorization.pincode.PinCodeActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
      key = bf7ba324-a1b5-459b-a9b5-57982e04d589
      watchDurationMillis = 5169
      retainedDurationMillis = 167

1694 bytes retained by leaking objects
Signature: b7f78e26e2d6b8d7cb98a9872c92c2d47a2e21
┬───
│ GC Root: Global variable in native code
│
├─ android.hardware.biometrics.BiometricPrompt$1 instance
│    Leaking: UNKNOWN
│    Anonymous subclass of android.hardware.biometrics.IBiometricServiceReceiver$Stub
│    ↓ BiometricPrompt$1.this$0
│                        ~~~~~~
├─ android.hardware.biometrics.BiometricPrompt instance
│    Leaking: UNKNOWN
│    ↓ BiometricPrompt.mAuthenticationCallback
│                      ~~~~~~~~~~~~~~~~~~~~~~~
├─ androidx.biometric.BiometricFragment$2 instance
│    Leaking: UNKNOWN
│    Anonymous subclass of android.hardware.biometrics.BiometricPrompt$AuthenticationCallback
│    ↓ BiometricFragment$2.this$0
│                          ~~~~~~
╰→ androidx.biometric.BiometricFragment instance
      Leaking: YES (ObjectWatcher was watching this because androidx.biometric.BiometricFragment received Fragment#onDestroy() callback and Fragment#mFragmentManager is null)
      key = a9a7b92c-b2f3-4192-8f6d-27ea1f480d66
      watchDurationMillis = 5168
      retainedDurationMillis = 166
      key = c2c4ced3-fad4-47f6-a2de-00ccbaf8ebfa
      watchDurationMillis = 5169
====================================
0 LIBRARY LEAKS

Library Leaks are leaks coming from the Android Framework or Google libraries.
====================================
METADATA

Please include this in bug reports and Stack Overflow questions.

Build.VERSION.SDK_INT: 29
Build.MANUFACTURER: Xiaomi
LeakCanary version: 2.2
App process name: ru.prosto.lk
Analysis duration: 8537 ms
Heap dump file path: /data/user/0/ru.prosto.lk/files/leakcanary/2020-03-23_16-46-29_150.hprof
Heap dump timestamp: 1584971199700
====================================
Aksi0m commented 4 years ago

Thank you for the report 👍 I'll look into it.

Aksi0m commented 4 years ago

@ShurikuS57 I looked into the leakage problem and unfortunately I couldn't do anything to fix it, because It is a problem in the androidx.biometric library. There are already some issues opened on the google issue tracker:

  1. https://issuetracker.google.com/issues/149344544
  2. https://issuetracker.google.com/issues/144919472

I advise you to star them in order to increase their priority so that we can get the fix as soon as possible.