[FFmpeg-devel] Massive memory leak in 6.1.1 (fixed on master)

James Almer jamrial at gmail.com
Wed May 1 22:44:36 EEST 2024


On 5/1/2024 4:40 PM, Dennis Mungai wrote:
> On Wed, 1 May 2024, 21:40 James Almer, <jamrial at gmail.com> wrote:
> 
>> On 5/1/2024 1:52 PM, Ville Syrjälä wrote:
>>> Hi,
>>>
>>> I ran into a massive memory leak while transcoding some audio
>>> books after upgrading to ffmpeg 6.1.1 from 6.0.1.
>>>
>>> Instead of the normal ~100 MiB rss it now exceeds 10 GiB in about
>>> ten seconds and keeps on going up.
>>>
>>> Command line used was approximately this:
>>> ffmpeg -activation_bytes XXX -i book.aax -map 0:a -map 0:v -c:a mp3 -c:v
>> copy \
>>> -ss 0.000000 -to 909.038005 -metadata track="1/69" -metadata
>> title="Chapter 1" book_01.mp3
>>>
>>> Bisect points to:
>>> commit 90fba2774304 ("avfilter/trim: switch to activate")
>>>
>>> I then tried master and discovered that the leak is has been
>>> fixed by these two commits:
>>> commit 84e400ae37b1 ("avfilter/buffersrc: switch to activate")
>>> commit d9e41ead8226 ("avfilter/avfilter: fix OOM case for default
>> activate")
>>>
>>> So those should be cherry-picked to the next 6.1 release (assuming
>>> there will be one). Both cherry-pick cleanly, and afterwards the
>>> leak is gone from the 6.1 branch as well.
>>
>> Just backported both commits. Thanks.
>>
> 
> Is this patchset available on FFmpeg 7.x?

Yes.


More information about the ffmpeg-devel mailing list