Skip to main content
Topic: mpv Nasty Memory Usage (Read 397 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

mpv Nasty Memory Usage

I made a mistake and posted twice (instead of edit). Delete this text, please. Sorry.

Re: mpv Nasty Memory Usage

Reply #1
Just figured out, where the cultprit is, but it  has been going on for a long time.

While playing youtube via mpv the memory usage is very, very huge. It may eat out memory for other apps. It's really hudge. It's 8.65x more than playing a local file.

I try to keep up with youtube "cat and mouse" that has been affecting me, so, I have been using nightly script build from github, but it shoudn't matter. I just want to play a video, but unfortunately I cannot in the currents state, unless I first download a copy do the hard drive.  Then memory usage is O.K.

This is a definite bug. I also tried jemalloc and got ready just to see what will happen and it failed to execute:
[alias mpv='LD_PRELOAD=`jemalloc-config --libdir`/libjemalloc.so.`jemalloc-config --revision` mpv --hwdec=vaapi --vo=gpu-next']

with a bunch or "red errors":

[ytdl_hook] Error relocating /usr/lib/libjemalloc.so.2: __register_atfork: symbol not found
[ytdl_hook] Error relocating /usr/lib/libjemalloc.so.2: __strcpy_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: arc4random: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __fprintf_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __openat_2: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __strftime_l: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __libc_single_threaded: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __memcpy_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __cxa_thread_atexit_impl: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __mbsnrtowcs_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __read_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: strfromf128: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __wmemset_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __mbsrtowcs_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __memset_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: strtof128: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __wmemcpy_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __sprintf_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __memmove_chk: symbol not found
[ytdl_hook] Error relocating /lib/libstdc++.so.6: __isoc23_strtoul: symbol not found
[ytdl_hook] Error relocating /lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
[ytdl_hook] Error relocating /lib/libgcc_s.so.1: __cpu_model: symbol not found
[ytdl_hook] Error relocating /lib/libgcc_s.so.1: _dl_find_object: symbol not found
[ytdl_hook] Error relocating /lib/libgcc_s.so.1: __memset_chk: symbol not found
[ytdl_hook] Error relocating /lib/ld-linux-x86-64.so.2: unsupported relocation type 37
[ytdl_hook] youtube-dl failed: not found or not enough permissions
Failed to recognize file format.
Exiting... (Errors when loading file)

Somebody knows how to fix this NASTY memory usage that on my low-end machine I can watch youtube?
Well: javascript, chomes/non-existent vaapi browser etc. is out of question (freeze). I prefers "suckless" and the fix.

Thanks for those who know and will answer.


P.S.: on the other note comparing resource usage using online radio playback (mp3 only, unfortunately) of mpv vs mpeg123 (and even mplayer) doesn't look good either. MPV needs real fixes.... This mpeg123 uses so few recources and even mplayer is better with online radio playback in terms of resources usage. Something's not right.

Re: mpv Nasty Memory Usage

Reply #2
I played the same video in MPV and Waterfox browser and couldn't see much difference in resource usage, CPU or RAM, nor did I get all those error messages. Perhaps you have a version mismatch problem between mpv and it's dependencies, those symbol not found errors suggest that, but I see you kind of did that deliberately for some reason.
Also note that apparently you need yt-dlp installed to play youtube videos in mpv, your errors mention ytdl_hook, ytdl is not so good anymore, yt-dlp is the better one at present.

Re: mpv Nasty Memory Usage

Reply #3
Press i and see what the output/context is, and press i+3 during playback to see the cache size, now on a youtube video on modern h/w and gpu-next i have around 250MB.