-
Notifications
You must be signed in to change notification settings - Fork 6k
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
The playerview retains its instance on a device rotation #4323
Comments
This sounds like an application bug to me. It's your responsibility to release each player instance, by calling |
I keep my player instance in Service, and I dont want it to be released on activity's ondestroy(). I just want my playerView reference to be cleared on activity rotation which is not happening right now. |
I don't understand what "The playerView retains its instance" means. It sounds like your application code is leaking something. Whatever you're seeing more instances of in the heap after every device orientation, you should trace the path from those instances to a GC root, which will show you the reference chain that's causing the leak. You need to fix that. We're not able to assist debugging your code. If you can reproduce with our demo app then that would be evidence that it's an ExoPlayer issue, in which case please reply here with concrete reproduction steps. |
Strangely enough, I fixed issue with just setting intent flag to Reorder_Front when switching between activities, and no more than 1 playerView instance in memory heap. |
Issue description
The playerView retains its instance even after activity is finished by calling finish(). The new instance is created everytime in onCreate(). You can observe this behaviour by rotating screen as well. This happenes until app crashes with OOM error.
Reproduction steps
Create playerView in XML, connect it with player instance in activity class. And rotate device or finish activity by transiting into any other one.
Link to test content
Will email you. It may happen with demo app too I guess, havnt tried though.
Version of ExoPlayer being used
V2.8.0
Device(s) and version(s) of Android being used
Xiaomi Redmi Note 5 Pro, Android 7.0
A full bug report captured from the device
Not needed. Just analyze java heap after each device orientation change. It keeps increasing until OutOfMemory Exception.
The text was updated successfully, but these errors were encountered: