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

SecondsView causing Memory Leak #23

Open
adi-itgg opened this issue Nov 16, 2021 · 2 comments
Open

SecondsView causing Memory Leak #23

adi-itgg opened this issue Nov 16, 2021 · 2 comments

Comments

@adi-itgg
Copy link

adi-itgg commented Nov 16, 2021

┬───
│ GC Root: System class

├─ android.os.Looper class
│ Leaking: NO (Thread↓ is not leaking and a class is never leaking)
D/LeakCanary: │ ↓ static Looper.sMainLooper
├─ android.os.Looper instance
│ Leaking: NO (Thread↓ is not leaking)
│ ↓ Looper.mThread
├─ java.lang.Thread instance
│ Leaking: NO (the main thread always runs)
│ Thread name: 'main'
│ ↓ Thread.threadLocals
│ ~~~~~~~~~~~~
├─ java.lang.ThreadLocal$ThreadLocalMap instance
│ Leaking: UNKNOWN
│ Retaining 2,0 kB in 57 objects
│ ↓ ThreadLocal$ThreadLocalMap.table
│ ~~~~~
├─ java.lang.ThreadLocal$ThreadLocalMap$Entry[] array
│ Leaking: UNKNOWN
│ Retaining 2,0 kB in 56 objects
│ ↓ ThreadLocal$ThreadLocalMap$Entry[].[8]
│ ~~~
├─ java.lang.ThreadLocal$ThreadLocalMap$Entry instance
│ Leaking: UNKNOWN
│ Retaining 28 B in 1 objects
│ ↓ ThreadLocal$ThreadLocalMap$Entry.value
│ ~~~~~
├─ android.animation.AnimationHandler instance
│ Leaking: UNKNOWN
│ Retaining 429,8 kB in 6701 objects
│ ↓ AnimationHandler.mAnimationCallbacks
│ ~~~~~~~~~~~~~~~~~~~
├─ java.util.ArrayList instance
│ Leaking: UNKNOWN
│ Retaining 429,6 kB in 6696 objects
│ ↓ ArrayList.elementData
│ ~~~~~~~~~~~
├─ java.lang.Object[] array
│ Leaking: UNKNOWN
│ Retaining 429,6 kB in 6695 objects
│ ↓ Object[].[2]
│ ~~~
├─ android.animation.ValueAnimator instance
│ Leaking: UNKNOWN
│ Retaining 429,4 kB in 6694 objects
│ ↓ Animator.mListeners
│ ~~~~~~~~~~
├─ java.util.ArrayList instance
│ Leaking: UNKNOWN
│ Retaining 84 B in 4 objects
│ ↓ ArrayList.elementData
│ ~~~~~~~~~~~
├─ java.lang.Object[] array
│ Leaking: UNKNOWN
│ Retaining 64 B in 3 objects
│ ↓ Object[].[0]
│ ~~~
├─ com.github.vkay94.dtpv.youtube.views.SecondsView$thirdAnimator$2$invoke$lambda-3$$inlined$doOnStart$1 instance
│ Leaking: UNKNOWN
│ Retaining 12 B in 1 objects
│ Anonymous class implementing android.animation.Animator$AnimatorListener
│ ↓ SecondsView$thirdAnimator$2$invoke$lambda-3$$inlined$doOnStart$1.this$0
│ ~~~~~~
├─ com.github.vkay94.dtpv.youtube.views.SecondsView instance
│ Leaking: YES (View.mContext references a destroyed activity)
│ Retaining 428,8 kB in 6675 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 me.a.Stream with mDestroyed = true
│ ↓ View.mContext

i tried to stop all animation but doesn't work
and i tried add to my onDestroy Activity still same

        playerView.cancelInDoubleTapMode();
        secondsView.setCycleDuration(0);
        secondsView.cancelPendingInputEvents();
        secondsView.stop();
@moneytoo
Copy link

The animation runs all the time, even when it's not visible. I worked around it by adding a animation control variable (toggled by start/stop) to break the infinite loop of animators (doOnEnd). I also had to remove animation start from YouTubeOverlay.changeConstraints().

@yoobi
Copy link

yoobi commented Mar 31, 2022

Hello, got the same issue, if that's possible for you could you perhaps make a PR so we clear this issue out of the lib ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants