[Libav-user] Full memory release after file processing is completed.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Full memory release after file processing is completed.

Anton Kolhidov
Hi everyone,
I am writing an application that handles many video files. I limit the
addition of new video files by the amount of consumed RAM. I'm having a
problem related to that after processing the video libav does not release
all using memory. I know that this is done to increase performance and then
this busy memory is used again. But when I process large files, RAM is busy
at 90% and this value doesn't decrease.

I reproduced this in the following example:
https://github.com/libav/libav/blob/master/doc/examples/decode_video.c

I tried using Ā«Adress sanitizerĀ» and valgrind. Adress sanitizer did not find
any errors. Valgrind showed   ~ 3 GB of still reachable memory after the
application was shut down.

How can I reset / clear this buffer in libav?

I processed the same file several times. Here is a graph of memory
consumption.
<http://libav-users.943685.n4.nabble.com/file/t376201/RrPPSGq.png>




--
Sent from: http://libav-users.943685.n4.nabble.com/
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Full memory release after file processing is completed.

Anton Kolhidov
Leak disappeared after removal

_pFormatCtx->streams[_videoStreamIdx]->codec->thread_count = _avThreadCount;
_pFormatCtx->streams[_videoStreamIdx]->codec->active_thread_type =
_avThreadType;
but decoding slowed down a lot.



--
Sent from: http://libav-users.943685.n4.nabble.com/
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".