Memory leak since 1.15.x on 300+ Plex Server Instances

I’ve installed 1.18.4.2171 as well now on my DS918+. Still getting Memory going through the roof after some time. But now it’s a least solved again by stopping and starting the Plex service. This is getting really annoying!

(All checkboxes for DLNA are disabled)

1 Like

I am also seeing a memory issue.

  1. no DLNA
  2. no DVR

i usually have to restart plex about twice a week

I’m recently started experiencing this issue. I’m using the official plex docker contain on my unraid server. Noticed 16gb ram being used up by my docker. Restart solves issue temporarily. I rarely update this docker but this was a fresh server rebuild and appdata transfer.

Has anyone from plex acknowledged this?
Has anyone tried a different plex docker container such as linuxio docker and noticed if this issue happens?
I’m curious to try a different docker container to see.
Is this also affecting windows plex server app?

All the docker containers did the same thing for me, tried them all. I’ve seen no acknowledgement of the issue.

Having the same issue. Plex is chewing all my ram.
32 GB ram on Win10

We acknowledge this is an issue that affects a number of users. I personally can reproduce this when running PMS in Docker with a container memory limit set, and am working with our build and server teams to try and track down this leak.

8 Likes

Same issue since I updated my perfectly working 1.18.6.2368 to the public 1.18.7.2438, installed on a Synology with docker. My 8Gb Memory is getting filled very quick while playing a video, which stops when memory is near 80% full and restarting the container doesn’t flush the memory… Reverting to 1.18.6.2368-97add474d and changing environment variable version:latest to version:docker to prevent self update at launch did the trick but I hope you’ll find the culprit.

I know another Synology user who had the same problem since previous 1.18.7.xxxx betas and had to rollback too.
Don’t know if it matters but we’re both using linuxserver/plex containers.

EDIT: gave a try to the 1.18.7.2457 release and disabled the container memory limit, same result, memory is filling very fast when I start to play a video, like 5% / minute.

EDIT 2: the problem appears only when I let hardware transcoding enabled, if disabled, the memory usage stays as low and stable as all the previous docker versions I’ve updated since 1.16.X.XXXX BUT with hardware transcoding enabled and perfectly working (hw tag is present next to transcode details).
As soon as I enable hardware transcoding and starts a video, memory fills fast and will never flush, I have to reboot the NAS to clean it. “hw” tag is present too and video is transcoded good, all seems to work OK except this memory leak bug.

1 Like

Hi, the culprit is, like many others here, the new iHD_drv_video.so driver. When deleted and relying on good old VAAPI driver, everything is fine, memory usage is stable. I saw there was a transcoder rework for Apollo lake cpus in 1.18.7 but it obviously doesn’t suit my setup.

EDIT: @ChuckPa provided a cleaner way by editing Preferences.xml to force select i965 driver without the hassle to delete iHD_drv_video.so each time you upgrade, big thanks to him.

2 Likes

Hey @chrisallen!

Thanks for your acknowledgement on this post! It’s good to see another kiwi round here too.

My symptoms of this issue are…

  1. RAM usage steadily climbs excessively high, to the point where my NAS crashes.
  2. I can only replicate it when playing avi files. (sample file included below)
  3. It occurs only when both Hardware Transcoding options are enabled.
  4. Restarting the Plex app does not clear the consumed RAM.
  5. Disabling the DLNA server does not help.

Workarounds that work for me:

  1. Disable “Use hardware acceleration when available” and “Use hardware-accelerated video encoding”
    OR
  2. Add to the preferences.xml file, VaapiDriver=“i965”

My test files to use for diagnostics and replication:

Server: Version 1.19.1.2630
Platform: XPenology - DSM 6.2.2-24922 Update 5

Hope this helps.

Phil.

I have also seen it when transcoding H.264 video on MKV containers.

please know I have not forgotten this issue, but my time has been spent elsewhere. This issue is top of mind and i’ll hopefully return to it next week.

3 Likes

I’ve been suffering with this exact issue for some months now, I stupidly thought it was my new NAS firmware that caused the issue but no it was i just a coincidence. I did actually have both Docker and DLNA running so I uninstalled Docker and stopped DLNA. My nas now runs beautifully as it did before. No stalling movies no 99% of ram being heated up.

I seem to have memory leak issues as well running Plex on Ubuntu 18.04. I have went as far as upgrading my server to 64 GB of RAM and allocating 16 GB of RAM to the VM running Plex.

The result is always the same. Memory use continues to climb until the VM runs out of memory and then everything will hang and crash until the server is restarted.

I am really looking forward to the Plex Dev Team to fix this long and outstanding issue.

Edit: DLNA is disabled and Plex is installed via package manager.

1 Like

@Neureka do you have HW transcoding enabled? And is it using the iHD driver? (Check the “Job Running” log line in the PMS log)

@chrisallen

I do have Use hardware acceleration when available and Use hardware-accelerated video encoding both enabled, despite not actually having an Intel Quick Sync compatible CPU or a dedicated graphics card. Could these settings being enabled cause a problem? I currently use a Ryzen 7 2700X CPU, and am not passing through any GPU.

I’m not sure about the driver. Is this only for hardware transcodes? I assume that I am using software transcoding because of what I mentioned above. I searched the logs and couldn’t find anything related to Job Running or the iHD driver.

Thanks for the help.

@chrisallen Just want to add that I am also experiencing this recently.

I am using the Linuxserver.io container and I am not using DVR, have always had DLNA disabled and do not use hardware transcoding. I’ve only started experiencing this recently (I think within the past month or so). I’m currently on Version 1.19.2.2702 of Plex (I just updated right before this post because Plex ended up using all my memory, if not close to all, so I had restarted the container which updated it). I have 32 GB of memory and my host OS is Centos 7.

If you need any more logs let me know what you want me to do and I’ll work on getting you logs.

Thanks,
Shark2k

I don’t know how long it’s been a problem, but I start noticing OOM errors recently because one of my docker containers died. I forgot to copy the free line before my buffer cleared, but I had less than 1GB of free RAM prior to restarting plex and over 20GB free after:

[root@prometheus ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)

[root@prometheus ~]# rpm -qa | grep -i plex
plexmediaserver-1.18.8.2527-740d4c206.x86_64

top - 12:10:08 up 521 days,  8:17,  1 user,  load average: 0.39, 0.33, 0.29
Tasks: 331 total,   1 running, 330 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.6 us,  1.0 sy,  0.0 ni, 97.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 32764436 total,   854308 free, 30675236 used,  1234892 buff/cache
KiB Swap:  6291452 total,   449576 free,  5841876 used.  1647288 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6510 plex      20   0   25.2g  21.3g   3496 S   1.7 68.2 293:51.97 /usr/lib/plexmediaserver/Plex DLNA Server
27143 steam     20   0   14.9g   4.2g   6072 S  16.5 13.5   3112:42 java -jar spigot-1.15.2.jar
 3876 plex      20   0 3946864 982.1m  10484 S   0.3  3.1 255:54.77 /usr/lib/plexmediaserver/Plex Media Server
24309 steam     20   0 9834884 870516   5848 S  28.3  2.7  14272:07 ./7DaysToDieServer.x86_64 -logfile ./7DaysToDieServer_Data/output_log__2020-04-03__22+
22449 steam     20   0   14.0g 645824   3336 S   3.8  2.0 691:30.86 java -server -Xms1024M -Xmx8072M -XX:PermSize=256M -XX:+UseParNewGC -XX:+CMSIncrement+

[root@prometheus ~]# systemctl restart plexmediaserver.service
[root@prometheus ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:          31996        7004       23762          14        1229       24560
Swap:          6143        4631        1512

top - 12:12:18 up 521 days,  8:19,  1 user,  load average: 2.61, 1.02, 0.54
Tasks: 335 total,   2 running, 333 sleeping,   0 stopped,   0 zombie
%Cpu(s):  4.8 us,  3.6 sy,  0.0 ni, 90.9 id,  0.7 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 32764436 total, 23459804 free,  7308776 used,  1995856 buff/cache
KiB Swap:  6291452 total,  1549352 free,  4742100 used. 25013464 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
27143 steam     20   0   14.9g   4.2g   6072 S  18.3 13.5   3113:03 java -jar spigot-1.15.2.jar
24309 steam     20   0 9834884 870516   5848 S  28.3  2.7  14272:44 ./7DaysToDieServer.x86_64 -logfile ./7DaysToDieServer_Data/output_log__2020-04-03__22+
22449 steam     20   0   14.0g 645824   3336 S   1.4  2.0 691:32.41 java -server -Xms1024M -Xmx8072M -XX:PermSize=256M -XX:+UseParNewGC -XX:+CMSIncrement+
 2946 steam     20   0   12.5g 424080   1532 S   0.3  1.3  84:45.22 java -cp AlchemistPG.jar net.osaris.alchemist.server.AlchemistServer -Xmx2G
 6344 plex      20   0 1400776  85296   6276 S   0.0  0.3   0:08.37 Plex Plug-in [com.plexapp.agents.subzero] /usr/lib/plexmediaserver/Resources/Plug-ins+
25982 mysql     20   0  970948  76272   2128 S   0.0  0.2   6:51.72 /usr/libexec/mysqld --basedir=/usr --datadir=/home/mysqldata/ --plugin-dir=/usr/lib64+
 6225 plex      20   0 2724936  50096  18168 S   0.3  0.2   0:01.41 /usr/lib/plexmediaserver/Plex Media Server
 6253 plex      35  15 1975292  46896   6488 S   0.6  0.1   0:04.28 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-740d4c2+
 6437 plex      20   0 1058348  40132   5576 S   0.0  0.1   0:02.63 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-74+
 3086 root      20   0  586452  16612   3200 S   0.0  0.1   1:08.48 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
 6298 plex      20   0  306948  13336   8304 R  88.9  0.0   0:07.42 /usr/lib/plexmediaserver/Plex DLNA Server

Looks like DLNA was eating up the CPU for a bit after restart, I waited for it to stop:

top - 12:19:46 up 521 days,  8:27,  1 user,  load average: 1.06, 0.77, 0.61
Tasks: 337 total,   1 running, 336 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.4 us,  1.1 sy,  0.0 ni, 97.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st

 6298 plex      20   0 2086648  44484  10576 S   0.0  0.1   0:27.75 /usr/lib/plexmediaserver/Plex DLNA Server

[root@prometheus ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:          31996        7173       22000          14        2822       24391
Swap:          6143        4630        1513

While I could just disable DLNA to resolve the memory issues, last night my cable went out for maintenance. I couldn’t actually watch anything on Plex, even though my server is on the network because the TV clients still require an internet connection. When my internet went out the last time, I enabled DLNA so that I would have a work around. If anyone knows how to get the Plex clients to work without an internet connection on the same LAN that would be great :smiley:

A year later and I still have this problem with DLNA and hardware encoding disabled. Any chance of an official update on this is issue?

1 Like

This might help: [HowTo] Use Plex with No Internet

I appreciate the response, I had already done most of those things. I could have logged in if I used a computer to watch it, but the TV clients don’t seem to use a cached login if the app isn’t running when it’s offline. It’s a rare case when the internet isn’t working, but it’s still an inconvenience that the TV clients don’t have an automatic offline/LAN mode.

Seeing the same issue- VM running Plex is freezing and OOM killer stops plex. Have been restarting Plex for months and figured it was issues with the hypervisor. Added the preferences.xml fix and will test.