I have been noticing more and more posts about high memory usage by plex on linux systems. This could not be further form the truth. As a matter of fact, linux is extremely efficient at memory management. Please see http://www.linuxatemyram.com/ for further explanation.
In short…
Linux is borrowing unused memory for disk caching. This makes it looks like you are low on memory, but you are not! Everything is fine! Disk caching makes the system much faster! There are no downsides, except for confusing newbies. It does not take memory away from applications in any way, ever! If your applications want more memory, they just take back a chunk that the disk cache borrowed. Disk cache can always be given back to applications immediately! You are not low on ram!
If you would like to see actual memory usage of your system easily, use htop instead of top.
sudo apt-get install htop
This “Explanation” is WRONG at least in my case and I suspect in the case of everyone who is talking about high memory usage. There is a real problem in the plex server that seems to grow and grow. This is what people have been complaining about not the misunderstanding about free vs cache. There is some truth that the poster is trying to bring to light and I don’t want to say that you can look at a lack of free memory and think that you have a problem. On linux free memory is really “free” + “cached”.
Now with that said the plex process itself growing to nearly 10 GIGABYTES of RAM is not reasonable. Below is the relevant line taken from “ps aux”:
plex 23605 22.0 83.3 12077648 10274480 ? S<l 22:27 4:33 Plex Plug-in [com.plexapp.agents.localmedia] /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 0.9.7.11.386-d353989 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/LocalMedia.bundle
This show that on my machine with 12GB of ram plex is using 10GB of that ram and another 2GB that is “virtualized” to swap. This means that plex has pushed nearly everything else on the computer out to swap. This high swap usage causes the system load to skyrocket as well my load average at the time of this snapshot was 9.54.
I haven’t tracked down a solid pattern to replicate the problem but it seems to happen after a few or more hours and watching at least one video.
I’ve been posting on another thread about high memory usage.
I’ve read that site and whilst I probably only understand 80% everything, I fall back to the fact that when plex media server is running RAM is at +/-95% (as shown by htop) and swap starts to get eaten until the point the computer crashes and I have to restart.
I think it’s related to the library scan as until that starts, either automatically or manually, RAM is under control.
plex 23605 22.0 83.3 12077648 10274480 ? S<l 22:27 4:33 Plex Plug-in [com.plexapp.agents.localmedia] /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 0.9.7.11.386-d353989 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/LocalMedia.bundle
think it's related to the library scan as until that starts, either automatically or manually, RAM is under control.
I second this conclusion.
I'm having the exact same problem - after I manually initiate a library scan (not sure if Deep or Turbo), the scan starts and after some time (about 10-15 minutes) the comuter starts to hang, to the point I have to restart.
Last time it happened I managed to get to System Monitor in time, switched to Processes tab and found that python script Plex Plug-in [com.plexapp.agents.localmedia] is using ~7.5GB out of my 8GB RAM. Killed it and the computer regained consciousness...
This is a serious issue with Plex that needs to be dealt with immediately.
Plex Server 0.9.7.22
Plex/Web 1.0.1
Ubuntu 12.10
I also am seeing high usage by Plex. As others have noted, it comes on after some time... not just when Plex starts. I'm going to experiment with the ulimit command : http://askubuntu.com/questions/120765/memory-limiting-solutions-for-greedy-applications-that-can-crash-os and I'll follow up with results when I have some time.
I second this conclusion.
I'm having the exact same problem - after I manually initiate a library scan (not sure if Deep or Turbo), the scan starts and after some time (about 10-15 minutes) the comuter starts to hang, to the point I have to restart.
Last time it happened I managed to get to System Monitor in time, switched to Processes tab and found that python script Plex Plug-in [com.plexapp.agents.localmedia] is using ~7.5GB out of my 8GB RAM. Killed it and the computer regained consciousness...This is a serious issue with Plex that needs to be dealt with immediately.
Plex Server 0.9.7.22
Plex/Web 1.0.1
Ubuntu 12.10
Just thought it was worth putting it out there - I have the exact same problem on a windows 7 machine. Usually when I am introducing new media files. The PlexScriptHost will max out memory on my system whilst executing the bootstrap.py against LocalMedia.Bundle causing the whole IO system to die. Killing the process brings the system back to life. In fact, It's doing it right now ;)
+1
I have no idea if my plus-one will help as I do not see ANY official reaction till now about this memory issue.
DEV's: please at least show that you have noticed that there must be some problem with the memory use. Ignoring the problem is not a solution.
My problems started after upgrading to the 0.9.8 branch. Currently on 0.9.8.1.46 on Synology Intel.
Update as per Davy0tv's suggestion;
4 Gb RAM
Intel Xeon CPU
Wired network (I have no idea why anyone would need this)
Distro: Synology DSM 4.2 build 3211
Install volume size: 9 Tb, 5 Tb free
Only local media; 321 movies, 4600 MP3 files, 33 TV shows (500 episodes), 17.000 pictures
I don't seem to have this issue on Ubuntu 12.04.
It would probably be helpful for the people with the issue to list the following:
PMS version:
Distro:
Machine Specs (Processor,RAM,Wired or Wireless):
Approx Media Size:
Media local/remote/channels?:
Install Folder Size?*:
*Incase ballooning of a plugin is messing things up.
There might be a blatant similarity between the machines plagued with the Mem usage issue.
Zombie thread...
I've noticed this on the 0.9.7.22, so it's not a 0.9.8 problem. In fact, I was just about to upgrade to 0.9.8, hoping to solve the problem.
Gentoo 3.5.7
AMD Phenom(tm) II X4 810 Processor
8GB RAM
Local video collection is 1TB.
No music.
Hard wired server, clients are mostly wireless.
I have iTunes, iPhoto, and Aperture sharing enabled (although I'll disable the latter two now, don't have photos).
I have some channels enabled, but I don't even use them. I'll disable them too.
To add, I am using Ubuntu Server 12.04 and have had no issues.
9.8.6
Celeron G1610
16GB RAM
Storage is Raid Z2 using ZoL 3TB used at this point.
Wired
having teh same problem also with 0.9.8 and 0.9.9 versions
starting scan - memory gets up to 8GB crashes and let a few services crash on my unraid system.
No issue here. That plugin on my system uses less than 1GB.
Ubuntu 12.04
Plex Media Server Version 0.9.8.18.290-11b7fdd
Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz
24GB Ram
5.35TB Mirrored Storage using ZoL (ZFS on Linux)
I am running plex 0.9.8.18 on CentOS, if I check it after a couple weeks uptime machine will be consuming 23~gb out of 24gb ram (this is viewed via htop)
reboot machine and about ~500mb in use
this machine only runs Plex
I have recently started using Plex on a machine running Ubuntu 12.04 and I'm having memory issues as well. It seems like especially the DLNA Server process is spontaneously inflating its memory consumption now and then. I can't see any correlation between me using the system and the memory patterns.
I've been tracking the memory usage of the Media Server and the DLNA Server process the past couple of days. (Specifically the VSZ and RSS fields as reported by "ps uU plex") The results can be seen here: https://docs.google.com/spreadsheet/pub?key=0Ah5y5ZJ2pZKkdDdOQ2VOdXcxRnp3aGU3S0tVODdGM3c&output=html (The numbers are in kilo bytes so when the graph says "5m" it means "5GB")
I used the following command to get total memory usage of all plex processes. I'm currently sitting at 9GB of memory usage. I'll repost my system info.
ps aux | grep -i plex | awk '{print $5}' | paste -sd+ | bc
Ubuntu 12.04
Plex Media Server Version 0.9.8.18.290-11b7fdd
Intel® Xeon® CPU E3-1245 V2 @ 3.40GHz
24GB Ram
5.35TB Mirrored Storage using ZoL (ZFS on Linux)
Found Restarting plexmediaserver fixes the issue;
sudo service plexmediaserver stop
Then
sudo service plexmediaserver start
Found this happens when encoding files via handbrake straight into a folder plex monitors
Found Restarting plexmediaserver fixes the issue;
sudo service plexmediaserver stopThen
sudo service plexmediaserver startFound this happens when encoding files via handbrake straight into a folder plex monitors
Restarting the plexmediaserver service does not fix the issue. It stops all plex processes and restarts them which reduces the current memory usage. Slowly but surely, the memory usage will reclimb.
Also, I have high memory usage and don't mess with encoding files via handbrake at all.
Restarting the plexmediaserver service does not fix the issue. It stops all plex processes and restarts them which reduces the current memory usage. Slowly but surely, the memory usage will reclimb.
Also, I have high memory usage and don't mess with encoding files via handbrake at all.
Well was stating what causes it to happen for me thats how it triggers for me
Unbuntu 14.04 Server (fresh install)
It's an older machine, but a nice one. Intel Quad Core Extreme @3.5Ghz and 6GB RAM. It's pretty much only running Plex.
Just got it setup and moved from my other linux box, running Ubuntu 14.04 Desktop where the problem never happened. I only just set up this new server in the last few days, we hadn't used it yet. But tonight my girlfriend was watching and I had just done a "refresh" on our TV shows area. A few minutes later tried to ssh into the machine, and it just hung there... While I waited, I tried on the terminal locally on the machine, same thing... After a long wait my SSH session finally got in... I did a top and plex going mad:
Posting to confirm I'm seeing the same issue here. Python gobbling up every bit of memory it can, and forcing everything out to swap, which ends up monopolizing cpu on vm's, as kswapd has to work pretty hard.
Particularly nasty for me, as I had let plex have priority over resources in hyper-v. Ended up killing most of the other VM's off, and my cluster with it.
This isn't something I can continue to use until this is resolved.