Your server has run out of memory (Not a HW problem)


Recommended Posts

Hi All

So I just successfully moved my Unraid installation to a brand new platform. (I love UNRAID!)

But my happiness was short lived !!!
 

On my old server I did sometimes experience the "Your server has run out of memory" but I could never find the cause?
And I always ended up rebooting the server, when this happened.

My new server have 128G RAM !!! (Twice that of the old one) and after running for only a couple of hours I got the error 😞

(I did do a burn-in and a extended memtest of the new platform and all is 100% ok!)

So two different platforms but with the same error, what in my UNRAID is causing this?


Diagnostic attached.




image.thumb.png.dd576b24e6ec309f7c69edf4dd9f93c2.png

Out-of-memory.zip

Link to comment

This is happening with no docker and no VM's running!
I just did a reboot and got the error message away from the "Fix common problem"
The only thing I am doing right now is moving my appdata back to the cachedrive.
But looking at the RAM on the dashboard I dont see high usage:

Why is it saying maximun size 256 GiB? (I only have 128GiB)
image.png.51dc932f0542c4663eca2bcde64f1a86.png
ZFS is high (But only like 15,6G) is ZFS capped to a special % of the total RAM?

I dont have any special logging enabled, and not using syslog either?
image.thumb.png.1c7af1d6219f5d3de251565301327302.png
Alos I have only one browser open to Unraid connect.

Link to comment

Sure, but currently waiting for the mover to finish (Very slow), but I will do that afterwards and see if this makes a difference.

Thanks for helping!

This seems to be for systems with little RAM and BTRFS? (I dont have any BTRFS drives anymore)
I am just in the progress of moving to ZFS for all my cache drives - so I can use snapshot etc.
So would this still be a viable solution?

Link to comment

The btrfs question was related to the plugin you suggested for the swapfile looks like it needs btrfs formatted drives?

 

Also got a new error, I havent seen before but resulting in the same memory error message?

image.thumb.png.b200aa967a7afabfbbdd7082a63ffc8c.png
I have not installed any new dockers? (Just moved everything to the new server now with ZFS cache?)

Link to comment

Thanks JorgeB, I can see my Plex is one update short. Will update right away!

mgutt helped me long time ago setting up at RamScratch folder for Plex at boot (Script), but I guess you talk about the docker advanced settings memory limit?
I was told that it would be best to remove them but that was in 2022 🙂


#!/bin/bash
mkdir /tmp/PlexRamScratch
chmod -R 777 /tmp/PlexRamScratch
mount -t tmpfs -o size=40g tmpfs /tmp/PlexRamScratch

 

(The 40g size is to accommodate the download feature in Plex). 


I did install the swapfile plugin and created it on a single U3 cache drive with btrfs - any recommendation on the size?
I went with the default values (Size: 20G)

 

I still think its strange that after upgrading from 64G to 128G of newer and faster RAM I have these low on RAM problems?
Is it fragmentation or is this some Kernel Memory Limit causing the OOM on Docker hosting?

Edited by casperse
Link to comment

I just discovered I have both the script and the advanced settings for RAMscratch

--no-healthcheck --log-opt max-size=50m --log-opt max-file=1 --restart unless-stopped --mount type=tmpfs,destination=/tmp,tmpfs-size=8589934592
And the above scripts, to create the RAMscratch 🙂

 

  • Any recommendation to use one over the other? (I cant remember if one solution is better to cleanup than the other in RAM?)
  • And did you want me to do a "--memory=8G" for the Plex docker?
  • Any size recommendation for the swapfile?


Sorry I have read many of the posts (Really old) and I am curious to if this have any effect on my memory problems?
(I also now have ZFS drives and I can see they also allocate more RAM)

Link to comment

Ok so my trouble shooting continues 🙂

  • I Have installed the swapfile plugin (You recommended above) successfully (Standard size setting is around 2G)

image.thumb.png.ab8e618c5af04a5c15c5a8e5b1d40777.png

  • I have moved the RamScratch settings to each of the dockers and also set memory limits
    • (PLEX) --no-healthcheck --log-opt max-size=50m --log-opt max-file=1 --restart unless-stopped --mount type=tmpfs,destination=/tmp/PlexRamScratch,tmpfs-size=68719476736 --memory=64G
    • (EMBY) --no-healthcheck --log-opt max-size=50m --log-opt max-file=1 --restart unless-stopped --mount type=tmpfs,destination=/tmp/EmbyRamScratch,tmpfs-size=8589934592 --memory=8G
    • (JELLYFIN) --no-healthcheck --log-opt max-size=50m --log-opt max-file=1 --restart unless-stopped --mount type=tmpfs,destination=/tmp/JellyRamScratch,tmpfs-size=8589934592 --memory=8G

 

After doing this I get a docker Warning: Your kernel does not support swap limit capabilities?
(Running the RamScratch as a script I never saw any warnings like below, did I do something wrong?)

image.thumb.png.cc4ac5497a656c6822a331ca9406aef4.png

I can see that the memory limit is implemented on the docker webpage:
image.png.98fcadf099dfe7d68ed9dba1a68f4829.png

But I still see this:
image.thumb.png.63ad6a887af53d93c1192ad6da23a507.png

And again today:
image.thumb.png.cf58fd3f4c0f37f69f4adbf67708ecd2.png

If these are to be just ignored then it would be nice not to have them in RED letters 🙂

Edited by casperse
Link to comment
1 hour ago, JorgeB said:

You may have other apps causing the server to run OOM, you can disable everything and start enabling one by one, then retest.


Yes, from the above error I can see a docker ID starting with c9e4ebfe searching for this I get the culprit? :
image.png.bb3712940ffed3417a01ebd9182ff10f.png
But I can see that this docker already have a limit of 1G:
--memory=1G --no-healthcheck --log-opt max-size=50m

 

The dev/shm will always be set to 50% of the available memory right?

image.png
So any input on what to do next? any other settings to limit memory for specific dockers

Edited by casperse
Link to comment
4 hours ago, trurl said:

If you're going to use that feature probably better to transcode to a path on ssd


After Plex removed the Sync feature and replaced it with the new Download feature, its not so bad, and the RamScratch gets empty pretty quickly.
Some restraint to the amount and size of files should be limited, but my initial tests have been okay.
But I am not using this now, I am focusing on eliminating the memory error - so it has no impact on the errors I currently get.

I have now set memory limit for all my dockers, hope to see a difference.
No morelogs since 16:00 what does this mean?

image.thumb.png.1fc6c819eedca03e2015c56916da8e05.png

Link to comment

Please can anyone help me?

  • I have installed the swapfile plugin
  • I have set a memory limit on all my dockers to 1G (If all dockers 0bey the rules of the limit then I shouldn't see anymore errors?)
  • I have tried stopping all dockers and only some dockers but I still get the Memory error?

Is there anyway to find out what is causing this?
Would syslog be able to find out?

 

This happened again today:

image.thumb.png.2701c20ddbe71fa686204b8c49389a9f.png

 

Systems are still running, but the error is resulting in Unraid killing random processes?

Link to comment

My problem is that i occurs every 10-12 hours so with the amount of dockers I have this would be very hard to do.

Update: 

So this could be caused by a single docker with a memory limit that breaks it?
Anyway to identify the docker, from the error message?

 

Edited by casperse
Link to comment
45 minutes ago, casperse said:

So this could be caused by a single docker with a memory limit that breaks it?

It's possible.

 

46 minutes ago, casperse said:

Anyway to identify the docker, from the error message?

Not that I know of.

 

46 minutes ago, casperse said:

My problem is that i occurs every 10-12 hours so with the amount of dockers I have this would be very hard to do.

It can be a pain, but it's still the best suggestion I have, extremely unlike this is un Unraid issue.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.