OutOfMemoryError when building Movie
See original GitHub issueAfter upgrading from 1.1.7 to later versions, OutOfMemoryError happens on MovieCreator.build() I think it’s related with removing deferred mapping.
Log from 1.1.14
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 788249407 byte allocation with 16769200 free bytes and 477MB until OOM
at java.nio.ByteBuffer.allocate(ByteBuffer.java:56)
at com.googlecode.mp4parser.AbstractBox.parse(AbstractBox.java:110)
at com.coremedia.iso.AbstractBoxParser.parseBox(AbstractBoxParser.java:107)
at com.googlecode.mp4parser.BasicContainer.next(BasicContainer.java:185)
at com.googlecode.mp4parser.BasicContainer.hasNext(BasicContainer.java:161)
at com.googlecode.mp4parser.util.LazyList.blowup(LazyList.java:30)
at com.googlecode.mp4parser.util.LazyList.size(LazyList.java:77)
at com.googlecode.mp4parser.BasicContainer.getBoxes(BasicContainer.java:80)
at com.googlecode.mp4parser.authoring.samples.DefaultMp4SampleList.<init>(DefaultMp4SampleList.java:36)
at com.coremedia.iso.boxes.mdat.SampleList.<init>(SampleList.java:33)
at com.googlecode.mp4parser.authoring.Mp4TrackImpl.<init>(Mp4TrackImpl.java:62)
at com.googlecode.mp4parser.authoring.container.mp4.MovieCreator.build(MovieCreator.java:57)
at com.googlecode.mp4parser.authoring.container.mp4.MovieCreator.build(MovieCreator.java:38)
Here is the Video with problem Video is made from android, and I’m not familiar with MP4 format, but seems like box header? is not correct, but it work well with 1.1.7 Thank you.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:11
- Comments:31 (5 by maintainers)
Top Results From Across the Web
How to deal with OutOfMemoryError when building ... - Reddit
Hi, I am having some difficulties when building 17.1. At 96% I would get an message saying: java.lang.OutOfMemoryError: Java heap space.
Read more >java.lang.OutOfMemoryError when running bazel build
If Bazel fails with any versions of the following error, it's because it ran out of heap space while trying to build. Example...
Read more >Developers - OutOfMemoryError when building Movie - - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >3.2 Understand the OutOfMemoryError Exception
One common indication of a memory leak is the java.lang.OutOfMemoryError exception. Usually, this error is thrown when there is insufficient space to allocate...
Read more >OutOfMemoryError - Android Developers
Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Attention everyone~: I just encountered this problem! It is so weird that mp4parser will allocate so much memory which the .mp4 file really do not need. After lots of tests, I notice that my own problem is origin from the .mp4 file itself! My file is created by myself on Android, I record the video to an .mp4 file by overriding an old file which name is the same as my new file. In this situation, maybe google code treat the file as usual then bug appears. So maybe the file is a bad one I think. My final solution is delete the old file before creating an new file, and in this case, the bug disappeared…
I ran into this last year. It’s extremely frustrating and it seems very obvious what the problem is - the code simply tries to create an enormous buffer. Please look at bogru’s comments above. He tracked down the precise commit where it was introduced. I used some of the code he posted here https://github.com/sannies/mp4parser/issues/205 to work around the problem. I have a hard time understanding why sannies is unable to reproduce this. I offered to provide a sample (the account brooksrbrown above), but he did not respond. I wish that he would take a good look at this problem. It is entirely fixable.