mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.85k stars 2.87k forks source link

libmpv osd memory leak #9844

Open ua0lnj opened 2 years ago

ua0lnj commented 2 years ago

Important Information

Provide following Information:

Reproduction steps

Each sending "overlay-add" commands increases memory usage. Each sending "overlay-remove" commands not decreases memory usage. Sending "mpv_destroy" command commands not decreases memory usage. Each time osd is called, the memory used increases and never decreases.

If interested to see the code: https://github.com/ua0lnj/vdr-plugin-mpv overlay-add: https://github.com/ua0lnj/vdr-plugin-mpv/blob/master/osd.c#L129 overlay-remove: https://github.com/ua0lnj/vdr-plugin-mpv/blob/master/player.c#L727

There are no errors in the logs, of course. That's probably how it always worked.

Dudemanguy commented 7 months ago

Do you have a more minimal reproduction of this assuming this problem still exists?

ua0lnj commented 7 months ago

The problem still exists. I do not know how else reproduce this with libmpv. I do not know other programs using libmpv.

litoj commented 7 months ago

I just started experiencing something that looks related - when watching a stream, the memory leaks, showing mpv in htop as around 500-700MB, but while mpv is playing, the overall usage goes up 10MB/s (with x4 playback) and stops growing only when I pause playback. I discovered this with this sample: mpv --ytdl-format=bv*[height=360],ba https://www.twitch.tv/videos/2041126076 You can increase the quality (height=720) if you want to see higher leaks. Happens only when playing at any >1.0 speed. I tested with previous version, downgrading my whole system to 2024-01-10 but still occures there, I probably just never played at higher speed for long enough.

Edit - created a new issue with more details: #13364