[FFmpeg-user] Guidance on debugging a potential memory leak

Carl Zwanzig cpz at tuunq.com
Thu Sep 1 22:14:59 EEST 2022


On 9/1/2022 11:24 AM, Carl Eugen Hoyos wrote:
> If valgrind does not show a memory there is no memory leak.

Probably; the tool is generally considered reliable but "never say never" 
(this is why we test the testing tools).

> A process may need more memory over time but that is not a leak.

True. OTOH it may fail to dealloc memory as appropriate; to quote from 
https://stackoverflow.com/questions/7726345/valgrind-doesnt-detect-any-memory-leaks-how-safe-is-that
===
You need to distinguish between memory leaks (memory that was allocated, but 
you lost all references to) and memory hogs (memory that was allocated, that 
you keep references to, but forgot to deallocate).

The later one can not be detected by valgrind, since valgrind doesn't know 
you did not want to use it anymore.
===

Some people consider both to be "leaks". Since it sounds like the OP is 
monitoring while ffmpeg is running, it could well be a failure-to-dealloc issue.

Later,

z!


More information about the ffmpeg-user mailing list