You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The countFrames() method of VideoFileInput is create a packet and never deleting the packet as part of acquiring the frames. Calling this method multiple times leaks memory and eventually you will get an OOM error similar to this:
java.lang.OutOfMemoryError: Physical memory usage is too high: physicalBytes (17801M) > maxPhysicalBytes (16384M)
at org.bytedeco.javacpp.Pointer.deallocator(Pointer.java:695)
at org.bytedeco.javacpp.Pointer.init(Pointer.java:127)
at org.bytedeco.ffmpeg.avcodec.AVPacket.allocate(Native Method)
at org.bytedeco.ffmpeg.avcodec.AVPacket.(AVPacket.java:50)
at org.jmisb.api.video.VideoFileInput.countFrames(VideoFileInput.java:124)
at org.jmisb.api.video.VideoFileInput.open(VideoFileInput.java:108)
To Reproduce
Steps to reproduce the behavior:
Call VideoFileInput.countFrames() in a loop to parse a file with many klv misb records in it. Watch memory consumption increase.
Expected behavior
I should be able to call this method as much as I want without it leaking memory.
Screenshots
N/A
Configuration (please complete the following information):
OS: RHEL 9
JDK [openjdk version "21.0.3" 2024-04-16 LTS ]
jMISB version or commit [1.12.0]
Additional context
To workaround this for our needs since we don't need the frame count we were able to create a copy of VideoFileInput bypassing countFrames() altogether in the open() method. We no longer run out of memory and crash our application.
The text was updated successfully, but these errors were encountered:
Describe the bug
The countFrames() method of VideoFileInput is create a packet and never deleting the packet as part of acquiring the frames. Calling this method multiple times leaks memory and eventually you will get an OOM error similar to this:
java.lang.OutOfMemoryError: Physical memory usage is too high: physicalBytes (17801M) > maxPhysicalBytes (16384M)
at org.bytedeco.javacpp.Pointer.deallocator(Pointer.java:695)
at org.bytedeco.javacpp.Pointer.init(Pointer.java:127)
at org.bytedeco.ffmpeg.avcodec.AVPacket.allocate(Native Method)
at org.bytedeco.ffmpeg.avcodec.AVPacket.(AVPacket.java:50)
at org.jmisb.api.video.VideoFileInput.countFrames(VideoFileInput.java:124)
at org.jmisb.api.video.VideoFileInput.open(VideoFileInput.java:108)
To Reproduce
Steps to reproduce the behavior:
Call VideoFileInput.countFrames() in a loop to parse a file with many klv misb records in it. Watch memory consumption increase.
Expected behavior
I should be able to call this method as much as I want without it leaking memory.
Screenshots
N/A
Configuration (please complete the following information):
Additional context
To workaround this for our needs since we don't need the frame count we were able to create a copy of VideoFileInput bypassing countFrames() altogether in the open() method. We no longer run out of memory and crash our application.
The text was updated successfully, but these errors were encountered: