RAM overuse? - PMS on Rapsberry pi crashes often

Server Version#: 1.14.1.5488
Player Version#: various (Windows 3.83.1, web, android, Amazon Alexa on Echo)

I am new to using Plex, but it seems I have been able to correctly set up my PMS on a Raspberry Pi 3 B+ for music playback on the players mentioned above. I am able to play locally as well as remotely, and am only using this server for music.

The issue I have is that sometimes the server becomes unavailable. (after 24 hours or so, maybe more, usually with very light usage)
If I turn on the monitor for the Raspberry pi, there is just a black screen, so it seems the whole thing has crashed.

I am new to Rasperry pi and Plex, so I am not sure if there are some power-saving settings on the Pi that I am not aware of (ie, it is turning off because it is idle) or if there are some PMS settings I can change to keep it from crashing the Pi (?).

I Googled this issue and most solutions provided are that it is related to power or heat.
I have a heatsink on the Pi, and it does not sound right to me that PMS would overheat the Pi anyway.
I have the CanaKit 2.5A USB Power Supply with Micro USB Cable and Noise Filter, so it should be getting enough power, and I believe CanaKit is considered “official.”

The Pi is only being used for PMS, my music is stored on a 256 GB USB (3.0) flash stick, the Pi is connected by 5Ghz wifi, and that’s about it.
I would think 2.5A is enough power for this.

If anyone who is knowledgeable about running PMS on Raspberry Pi has any advice for keeping my server running, I would appreciate it.

PMS cannot crash your Pi if it’s a healthy system. It can only trigger a defect in your setup (e.g. overheating). That’s why you have to identify what’s wrong with your hardware.

Till you have found the hardware problem it’s always recommended to disable the CPU hungry tasks, as e.g. discussed here:

Thanks very much for the info.
In that case, I am hoping it is overheating from the tasks you mentioned as I have installed nothing else to my Pi other than PMS.
I will try disabling them and seeing how it goes.

Unfortunately, it seems to have crashed again after about 24 hours.
Very minimal usage during this time, as well.

Do you have any tips on how to troubleshoot?
Thanks.

Btw: please google RPi 3B+ crash. There are many other users discussing similar problems. Most users had their RPi replaced by the seller and this fixed the problem. It appears there is a bad batch of RPi 3B+ out there.

Thank you for the guidance.
In your experience, does this sound like I have a bad one?
In normal circumstances the Pi CAN be left on 24/7, right?

Well, just tonight I ran updates/upgrades, moved the USB flash drive to another port (maybe it’s generating heat?) but the whole thing crashed within 3 hours this time.

Could you tell me how to find some logs and what I should be looking for?
Thanks.

Edit:
So here’s another question: How much memory is PMS supposed to be using?
After rebooting after this latest crash, I opened up Task Manager and one of the Plex tasks has a steady climb in RSS. As of right now it is over 460 MB (just about half) and increasing.
If this keeps up, could this be causing the crashes?

2nd Edit:
Leaving it on overnight, the memory used by that one Plex task rose to 532 MB (and seems to still be increasing, but slower) and total memory usage is now 698 MB of 927 MB. Wondering if this is normal…

3rd Edit:
RSS used by the Plex task rose to 779.7 MB, overall Memory usage went to 876 MB of 927 MB and the whole system froze (cannot move cursor, CPU and Memory usage reports are not updating/fluctuating). This crash took just about 10 hours from the last boot.
Is this safe to conclude that this memory issue is causing my problems?
I have no idea how to go about fixing this, so if anyone has any tips I would appreciate it.
Thanks.

Here is an image of the task manager status at the time of freeze.

Sorry for multi-posting, but I have changed the title now that I have identified a problem (maybe THE problem) and hoping this gets some visibility.
If anyone knows anything about this RAM issue detailed above or has any tips for how to go about troubleshooting, I would really appreciate it.
Thank you.

Have you upgraded your PMS to the current 1.15.2 release?

Please post the output of ps aux | grep -i plex so we can actually identify the process that consumes all of your memory. The Task Manager screenshot is not much of a help :neutral_face: However, Linux typically just kills a process if it requires too much memory. In theory, only PMS should stop, not your RPi.

Thanks for the follow up.
Yes, I have upgraded to the latest version.
Well, I tried to open chromium so I could copy/paste the output and the Pi froze up (memory usage from the plex task was already very high).

Earlier, messing around with the displays showed me that the culprit Plex task was also called DLNA Server or /sbin/init splash, depending on the display option I selected.

I was also asking on reddit for some tips, and a user there suggested that I try to use systemd to limit the RAM usage of Plex to 650 MB. (sudo systemctl edit plexmediaserver.service) This did not seem to do anything as it continued to increase beyond that.

I will try to post with the requested output by posting directly from my Pi.

Edit: here is the output: (taken shortly after rebooting)

plex 361 0.0 0.0 1888 372 ? Ss 17:32 0:00 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib “/usr/lib/plexmediaserver/Plex Media Server”
plex 363 4.3 7.3 358528 69452 ? Sl 17:32 0:16 /usr/lib/plexmediaserver/Plex Media Server
plex 486 4.2 3.2 183868 31236 ? SNl 17:32 0:16 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-782228f99/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.15.2.793-782228f99 /usr/lib/plexmediaserver/Resources/Plug-ins-782228f99/System.bundle
plex 834 13.9 6.0 258904 57748 ? Sl 17:32 0:51 /usr/lib/plexmediaserver/Plex DLNA Server
plex 837 0.0 1.2 105396 11988 ? Sl 17:32 0:00 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.15.2.793-782228f99 32600 /waitmutex
plex 865 2.9 3.0 133540 29200 ? Sl 17:32 0:10 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-782228f99/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.15.2.793-782228f99 /usr/lib/plexmediaserver/Resources/Plug-ins-782228f99/PlexMovie.bundle
pi 1518 0.0 0.0 4372 584 pts/0 S+ 17:38 0:00 grep --color=auto -i plex

Here is the output after it has been running for a couple hours.

plex 361 0.0 0.0 1888 224 ? Ss 17:32 0:00 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib “/usr/lib/plexmediaserver/Plex Media Server”
plex 363 6.9 3.6 398364 34904 ? Sl 17:32 15:52 /usr/lib/plexmediaserver/Plex Media Server
plex 486 0.3 0.4 175672 3856 ? SNl 17:32 0:41 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-782228f99/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.15.2.793-782228f99 /usr/lib/plexmediaserver/Resources/Plug-ins-782228f99/System.bundle
plex 834 15.9 56.0 746848 532384 ? Sl 17:32 36:17 /usr/lib/plexmediaserver/Plex DLNA Server
plex 837 0.0 0.2 105396 1940 ? Sl 17:32 0:00 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.15.2.793-782228f99 32600 /waitmutex
pi 9577 0.0 0.0 4372 532 pts/0 S+ 21:20 0:00 grep --color=auto -i plex

Interesting. Do you use DLNA or only normal Plex clients? DLNA is a legacy feature of Plex and not often used anymore (and may have bugs cough). If you do not need it, please disable it.

https://support.plex.tv/articles/200350536-dlna/

You know, I didn’t know what DLNA was until this morning when I started googling around for it. I am pretty sure I do not use it, as I play everything through Plex Players (website, Windows program, Android app, Alexa skill).
I disabled it, and it seems like everything is still playing properly.

It has been about 6 hours since the last reboot after disabling DLNA and the RAM usage seems very normal and minimal. The DLNA server task does not seem to be present.
Memory used by cache seems to be high, as does virtual mem, but that may be normal.
I will just have to wait it out and see how it goes. If nothing freezes or crashes in the next 24 hours, then I guess the DLNA ram usage is what my problem was (hopefully it is that simple).

Thanks very much for your help. I will update and let you know how it goes.

If you have time at some point to get diagnostics to register the issue - please adapt the script here Server Crashes While Loading EPG Data to capture memory from launch and collect logs zip periodically

I don’t want to jinx it, but it has been over 48 hours since I have disabled DLNA and there have been no freezes/crashes or any RAM issues.
That could very well have been the cause of all my trouble. Thanks for your help troubleshooting. I will update if anything falls apart.

If I do have trouble again, I will get some logs to submit. If I have time this weekend, I could re-enable DLNA for a while and get some logs if that would be helpful.

Thank you.

Thanks - the important bit is the output of the memory usage capture script from launch time (for the DLNA Server PID) together with the debug logs

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.