Is my server using reasonable amounts of memory, or is something wrong?
I'm hosting a modded server for some friends (1.19.2, Forge, ~60 mods including libraries and very small QOL stuff, ~15 "big" mods). Currently, the server uses 4 - 5 GB of memory if nobody is online, and 7 - 8 GB if one to four people are online. Since my server only has 8GB of RAM, this leads to frequent crashes.
Is this amount of memory usage reasonable for such a server, or should I start looking for a problem like a memory leak caused by some mod?
25 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by auswahlaxiom#0
are you using a host?
Yes, Witherhosting
Try using aikars flags (flags.sh), this doesn’t seem like normal behaviour. If this doesn’t rectify it, try contacting their support
Try remove mods to see if any of them is causing the problem as well
aikar flags dont help much if anything on forge tbh
if u have aikar flags remove alwayspretouch and get xmx set to 6.5-7 gb
Tbh regarding flags for forge.., I’d try to find a big modpack with similar mods as yours and just copy the flags they use
And I’ve learnt something new!
Sorry for the dumb question - but in which subfolder/file can I find the flags? 🤔
The flags are options u use when starting the server
They are located in ur .sh or .bat file u run when starting
For example ur server is using 8gb so u prob have the -xmx8000m flag
But there’s a lot more flags u can use to tweak how Java and the garbage collector works so it’s optimized for Minecraft
Aikar's Flags | PaperMC Documentation
Aikar's flags are a set of JVM flags designed to improve the performance of your Paper server.
These are the standard with explanations for non forge
Forge is a little different, but u mostly use the same ones
Found it, thanks!
Is there any particular reason to not use alwayspretouch? I looked at some modpacks and they use that it, and the consensus in online forums seems to be that you should use alwayspretouch if your heap is "large" (whatever that precisely means, but 8gb feels large to me).
How much ram do u have outside of 8gb on ur machine
None 😄
Yeah that’s your issue
You need overhead
Your machine has other stuff it needs to do
And if u give it all to Minecraft
It will boom
That’s why ur crashing
Notice how he said set it to 6-7gb
Because u wanna leave extra for the machine
The extra we call overhead
Yes, I know that - but since I was running the server with a hosting company and the startup arguments default was set to 8gb, I assumed that the overhead for the "other stuff" was already accounted for by the provider 🤔
Oh well some hosts are shit and don’t do overhead
You should ask them
What host are you using?
Some peeps mite already know if they do overhead if it’s a common host
causes some issues on pterodactyl
Short explanation is the boot up process of the the Jvm takes the most memory ontop of what ur allocating. Ptero is in a container so ur only giving it the bare minimum ram for the. When h pretouch ur forcing the full ram early on when ur also using all ur overhead, so u insta hit the memory cap and ptero or Linux will shut down the server for being oom (out of memory )
But if ur in a container u don’t need to worry about pretouching because nothing else will be feeding into ur ram usage
Thanks for the explanations!
Witherhosting, I asked the support but didn't get an answer yet
I changed some of the startup flags which improved everything by a little bit, and the server now runs stable at ~3-5 GB memory usage - however, something (I don't know what yet) still triggers the memory usage to skyrocket and causes a crash from time to time, so I guess it is basically confirmed that something causes a memory leak, and I'll have to try and find that something 😦
Thanks everyone for the help, I'll leave the question open for 20 more minutes in case someone still wants to tell me about something, then I'll close it ^^
nope very likely not a memory leak
skyrocketing/memory usage going up is a normal thing on pterodactyl/docker
Well, then I am completely confused on what to do now O.o
well remove alwayspretouch and reduce xmx
Already did that and it crashed once afterwards, but it has been running consistently afterwards for a while now - I'll guess I just close this question and start a new one if the issues don't stop
!close
post closed!
The post/thread has been closed!
Requested by auswahlaxiom#0