FolioReader / FolioReader-Android

A Java ePub reader and parser framework for Android.
BSD 3-Clause "New" or "Revised" License
2.24k stars 710 forks source link

Memory leak in TextToSpeech activity #481

Open animesh-sharama opened 3 years ago

animesh-sharama commented 3 years ago

Issue / Feature - Memory leak in TextToSpeech activity FolioReader version - 0.5.4 FolioReader Stock / Modified - Stock Android SDK - 29, 30 Mobile / Tablet / Emulator Info - Samsung Galaxy S20, Google pixel 2, One Plus 8 Crash / Error -

        ┬───
        │ GC Root: Global variable in native code
        │
        ├─ android.speech.tts.TextToSpeech$Connection$1 instance
        │    Leaking: UNKNOWN
        │    Anonymous subclass of android.speech.tts.ITextToSpeechCallback$Stub
        │    ↓ TextToSpeech$Connection$1.this$1
        │                                ~~~~~~
        ├─ android.speech.tts.TextToSpeech$Connection instance
        │    Leaking: UNKNOWN
        │    ↓ TextToSpeech$Connection.this$0
        │                              ~~~~~~
        ├─ android.speech.tts.TextToSpeech instance
        │    Leaking: UNKNOWN
        │    ↓ TextToSpeech.mUtteranceProgressListener
        │                   ~~~~~~~~~~~~~~~~~~~~~~~~~~
        ├─ android.speech.tts.UtteranceProgressListener$1 instance
        │    Leaking: UNKNOWN
        │    Anonymous subclass of android.speech.tts.UtteranceProgressListener
        │    ↓ UtteranceProgressListener$1.val$listener
        │                                  ~~~~~~~~~~~~
        ├─ com.folioreader.mediaoverlay.MediaController$2$1 instance
        │    Leaking: UNKNOWN
        │    Anonymous class implementing android.speech.tts.TextToSpeech$OnUtteranceCompletedListener
        │    ↓ MediaController$2$1.this$1
        │                          ~~~~~~
        ├─ com.folioreader.mediaoverlay.MediaController$2 instance
        │    Leaking: UNKNOWN
        │    Anonymous class implementing android.speech.tts.TextToSpeech$OnInitListener
        │    ↓ MediaController$2.this$0
        │                        ~~~~~~
        ├─ com.folioreader.mediaoverlay.MediaController instance
        │    Leaking: UNKNOWN
        │    ↓ MediaController.callbacks
        │                      ~~~~~~~~~
        ╰→ com.folioreader.ui.fragment.FolioPageFragment instance
        ​     Leaking: YES (ObjectWatcher was watching this because com.folioreader.ui.fragment.FolioPageFragment received Fragment#onDestroy() callback and Fragment#mFragmentManager is null)
        ​     key = 7ecef8b1-4e81-49ec-9fc7-8e862fe57bc9
        ​     watchDurationMillis = 24842
        ​     retainedDurationMillis = 19837

        METADATA

        Build.VERSION.SDK_INT: 30
        Build.MANUFACTURER: Google
        LeakCanary version: 2.4
        App process name: com.example.testandroid
        Analysis duration: 15000 ms

Steps to reproduce / Describe in detail -