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
java.lang.OutOfMemoryError #7354
Comments
Your app was using all its allowed memory and ExoPlayer was denied allocating a small 64B object. Without more context as to what was using all the memory in your app, I can not help you. Please provide complete information as requested in the issue template. The issue template can be found here. If you're unable to share bug reports or test content publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #1234", where "#1234" should be replaced with your issue number. Please also update this issue to indicate you’ve done this. |
I don't know what information I need to provide. What about some logs? And the log may not point to ExoPlayer sometimes, but ExoPlayer actually accupy too much memory, which leads to OOM fatally. @krocard If you need more information, please feel free to tell me what to do. I really want to find the root cause. Thanks. |
From your log, it seems the system is only allowing your app to allocate 128MB of memory.
Quickly skimming through the log I'm not sure why the memory is so limited. There are codec used (OMX.MTK.VIDEO.DECODER.AVC), but 128MB is very limited. Which Xiaolajiao device are you using, and how many memory does it has? |
If you're not already doing so, it may be a good idea to enable |
Honglajiao Note4X Android 6.0, API 23。 |
The video is short but very large(about 249 MB), so I cannot upload it. |
Here are some other logs:
|
Here is my demo: ExoPlayer2Demo.zip
|
I think this OOM is due to several factor:
|
When I go to office, I'll send it to your email asap. I think I have to enable |
The media file has been sent to dev.exoplayer@gmail.com. |
@krocard How is it going? May I ask that whether you have any workaround about this issue? |
@jhwsx Your issue is high on my priority list, and I'm planning to build your test app to take a loop at why the memory usage is so high, but I have other tasks too. |
@jhwsx Thanks, we received the link. I unfortunately do not have have the permission to access the file. Could you give me read access? You should have received an email with my permission request. |
Sorry,but I‘m not familiar the use of Gmail. I have enabled sharing settings by clicking a button. Could you please check whether the read access has been given. |
Thanks @jhwsx, I was able to download your media. Will test it now. |
The issue seems to come from the SampleDataQueue. It allocates an 132MB link list of of more than 2000 element, each containing a Byte[] array of around 64kiB. This also forces many garbage collection, around ~31 per second. (I also wonder if a 2k depth is bad for GC perf?) |
Given that the file bitrate is 42Mb/s, and that the default buffer size is What is also surprising is that the DEFAULT_VIDEO_BUFFER_SIZE is of 500 elements of 64k (32MB). But I'm measuring 2k element in the link list. (1) the bitrate is in bits, not bytes and 50000 is 50s, not 5s, as corrected by @ojw28, |
That's 42Mbit/s right? So you'd only expect 210/8 = 26MBytes for 5 seconds. |
@jhwsx, by setting |
Correct. I definitely do not understand why so much memory is used then. @tonihei could you take a look?
In your demo app, this could be done as such: SimpleExoPlayer player = new SimpleExoPlayer.Builder(MainActivity.this,
new DefaultRenderersFactory(MainActivity.this))
.setLoadControl(new DefaultLoadControl.Builder()
.setPrioritizeTimeOverSizeThresholds(false)
.createDefaultLoadControl())
.build(); |
The default buffer size is 50 seconds, not 5. So that probably explains the difference. |
Definitely explains it then, thanks for double checking my (wrong) math. |
Well done! |
The text was updated successfully, but these errors were encountered: