Memory Full

Server Version#: Version 1.15.4.919
Player Version#: Web Version 3.83.1
OS: Ubuntu 18.04.2 LTS

My RAM has been filling up from Plex. Running Ubuntu. There’s nothing running or transcoding and it doesn’t clear out unless i restart the server. Will jump to about 90% within 24 hours.

Not sure where to even start.

DEBUG (not VERBOSE) Logs please? Restart PMS and after about 2-3 hours, please download the logs and attach the ZIP file.

Also, please include ps -ef | grep -i plex console output

1 Like

Will do. Thanks!

Here are the logs and screen shot immediately after a restart.
Plex Media Server Logs_2019-04-20_00-00-01.zip (5.4 MB)

And then here is the logs from this morning after running all night. Can see the memory is slowly starting to fill. It was overnight so there was almost no activity.
I’ll send another tonight after work.
Plex Media Server Logs_2019-04-20_09-18-36.zip (7.1 MB)

And then here is the console output:

  1. htop is showing you threads. There is no gain. Regular pids is more than enough. ps confirms this.

  2. Permission errors

Apr 19, 2019 23:55:14.367 [0x7ff8e046e780] ERROR - Error creating directory "/volume2/temp": boost::filesystem::create_directories: Permission denied: "/volume2"
  1. Is this XPEnology or just attempts to write to a Synology and store transcoder temp across the network?

If transcoder temp over the network, this is extremely ill advised. iNotify, which the transcoder and PMS require for certain operations, do not work over a network mount.

  1. Everything else I see is DVR related; from XMLTV to EPG and unfortunately nothing I can do here. It appears the HDHR is working but impossible to tell at this point.

Can you remove a tuner for now (shut down DVR) and see if the problem persists?

Thanks for the quick info!
Here’s the current htop.

/volume2 is a second local HDD. And /volume2/temp is a local folder, it is not over the network.
My media folders are over the network on a Synology (not XPEnology) and mapped.

I definitely have permission issues. I thought I fixed them. I used to use /tmp and switched to /volume2/temp in an effort to free memory, but still have the issue.
I can write to the DVR folders just fine as I can record and play back from them. However, it looks like I can not save to “PlexBackup” or “temp”.
– I just updated it from “/volume2/temp” to “/home/howard/volume2/temp” maybe this will fix it.

please don’t use htop? regular top is fine.

also free -m and ps -ef work even better. No screenshots required.

hahaa ok. I’m just used to htop.

By changing the file path for the transcoder, it is now writing to the Transcode/Sessions folder. I think was my main problem. I restarted and will see if the memory continues to build.

              total        used        free      shared  buff/cache   available
Mem:          15913        2725        8738         237        4449       12654
Swap:          2047           0        2047

so a 16 GB machine. 2.7 GB in use by programs. 4.5 GB used by buffers

Right. I think fixing that write error you found is helping my issue.
I wanted to try and use the ram for my transcodes, but it was just filling up and didn’t clear out. It was staying around 12-13GB even after 24 hours of no use.
That’s when I changed to /volume2/temp

Network mounts won’t help a memory situation. They will exacerbate any other issues.

Thanks for the help! I just noticed the memory issue with the recent PMS update and having the CPU and RAM usage on the dashboard. It was sitting around 80-90%. Hope this fixes it. So far it is looking good. I’ll keep an eye on it and let you know if the problem continues.

You also do realize, LInux will use almost ALL of memory for something?
By using it for read cache, it improves performance. Those memory pages are instantly available when needed. The kernel simply takes that page or as many as it needs from the buffer list.

In the list you showed, it was only really using 2.7 of the entire 16 GB.

My system, at this moment is

[chuck@lizum ~.460]$ free  -m
              total        used        free      shared  buff/cache   available
Mem:          15988        4976        2831         123        8179       10556
Swap:         16383         381       16002
[chuck@lizum ~.461]$ 

That 8GB in use… all as buffers for performance.

1 Like

Would it be better to go back to /tmp vs using my HDD for my transcodes? I just noticed it filled up faster (which is fine while in use), but it wouldn’t clear out when there was no trascoding in process. I get it should be stored on there for faster access, but how does it handle once its full? Will it remove older sessions to make room for more?

/tmp is a tmpfs (RAM) filesystem. Nice part is a) fast b) given back as soon as transcoding is done.

Some prefer to go directly to the Linux kernel ramdisk (/dev/shm) to keep /tmp and the ramdisk separate. It’s a little more restrictive but has its advantages.

Transcodes don’t demand that much. A 32 Mbps movie requries ( 32/8 = ) 4 MB/sec of performance. It’s local to the system so all file locking is available.

The drawback is it’s 8GB max (1/2 of memory) . Do you transcode that much at once you have 8 GB of media “in flight” (not file size – actual stream data per second) ?

As next step, use /tmp. Keep it as simple as possible.
The default is already on local disk in /var/lib/plexmediaserver

The fancier it gets, the easier it is to muck up the plumbing :slight_smile:

EDIT: /tmp on Debian is not RAM. /dev/shm is the “Transcoder temp” to use if you want that… the /tmp directory is HDD. It’s still plenty fast enough.

After running all night, here is what i have now.

              total        used        free      shared  buff/cache   available
Mem:          15913        7829         156         237        7928        7518
Swap:          2047           0        2047

Is this more normal then?

more normal = clean default install of OS. No ramdrvs, vms or shared temp gimmickry with microsoft. good luck & lemme know
-wbm
ps. for example, chuck’s swapdrive is twice as big as all my actual RAM… and no problemos here

Notice:

Swap:          2047           0        2047

Nothing is swapping. All good. Let it alone.

As for my “Normal”,

8 GB main memory,
8 GB swap partition on this i7-3740qm (2012 CPU)

This is about to change. The AMD Ryzen 3000’s are coming. I will build one on the ASUS ROG w/ 64GB RAM. Swap will exist only to appease the bootloader. I use this machine for a lot of mathematics and heavy VM work

1 Like

Awesome. Think about all that time back then WASTED diddling over swap drive partitions & swapfiles. When I worked at dell this tech bragged about buying a new 8gb HDD, and the instant reply coming from our chief wuz “your whole life won’t even fill as much as 8gb”.

-wbm