Consistently high RAM usage. Startup command issue?

I've been running a small Fabric server for me and some friends and have been having a lot of memory issues recently. I used the servers gamepanel to set up the server initially and after trying a variety of optimization mods, and lowering view distance I'm still struggling to solve the issue. Today after further research it seems it may be because I don't have additional java arguments set for when the server starts and just have the full 4gb allocated right off the bat. I'm sure I could trial and error this process but if somehow has some time to hop on a quick voicecall to guide me I would greatly appreciate it.
103 Replies
Admincraft Meta
Admincraft Meta•2y ago
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 tommytimbo#0
lavaking46
lavaking46•2y ago
use aikars flags and xms
lavaking46
lavaking46•2y ago
https://flags.sh also helps
flags.sh
flags.sh
A simple script generator to start your Minecraft servers with optimal flags.
TommyTimbo
TommyTimboOP•2y ago
I'll give it a go. Should I be adding them to the "additional java options" section
No description
lavaking46
lavaking46•2y ago
probably. i'm not entirely familiar with that panel
TommyTimbo
TommyTimboOP•2y ago
šŸ‘ no problem. will do some testing and report back. this site is very helpful
lavaking46
lavaking46•2y ago
yep
CtrlAltDelMe
CtrlAltDelMe•2y ago
Where are you seeing the memory usage? @TommyTimbo
TommyTimbo
TommyTimboOP•2y ago
I just stopped the server and with no one online the memory was at 3.09/3.91
No description
CtrlAltDelMe
CtrlAltDelMe•2y ago
It's normal for the panel to report that the server memory is high Just don't use -xx: alwayspretouch in your startup
TommyTimbo
TommyTimboOP•2y ago
Sure thing. Whats the reasoning? I see it being used in most recommended startups
CtrlAltDelMe
CtrlAltDelMe•2y ago
You should get memory usage insights from spark Alwayspretouch loads (aka pretouches) all pages. This can make the docket container to consider the server is going oom It's like telling the server to load some stuff in startup instead of loading it while the server is running
TommyTimbo
TommyTimboOP•2y ago
Will Spark be useful to me if I don't understand the java classes in the heap dumps?
CtrlAltDelMe
CtrlAltDelMe•2y ago
Do you have lag issues or it's just that you're worried that the panel memory usage is so high? It's really useful for stuff like seeing if the garbage collections are being done correctly, or what's lagging the server But afaik heap dumps are hard to read, I think not even leche knows how to debug heapdumps šŸ˜…
TommyTimbo
TommyTimboOP•2y ago
The other night with 3 people online we ran oom 3 times with a view distance of 8.
CtrlAltDelMe
CtrlAltDelMe•2y ago
If you had alwayspretouch it might have been that It might ā„¢
TommyTimbo
TommyTimboOP•2y ago
I'm unsure if there are even startup flags right now. This panel is annoying
CtrlAltDelMe
CtrlAltDelMe•2y ago
You He She 🤭 It's worth removing it & set Xms to 128M
TommyTimbo
TommyTimboOP•2y ago
Oh wow okay, I was going to set the xms to 2000m and the xmx to 2000m as well
CtrlAltDelMe
CtrlAltDelMe•2y ago
Only 2 gb? You guys don't have many mods right?
TommyTimbo
TommyTimboOP•2y ago
A few datapacks from Vanilla Tweaks and then optimization plugins
CtrlAltDelMe
CtrlAltDelMe•2y ago
I see. Plugins? You mean mods?
TommyTimbo
TommyTimboOP•2y ago
yes
CtrlAltDelMe
CtrlAltDelMe•2y ago
May I ask why you guys haven't used paper? Out of curiosity btw
TommyTimbo
TommyTimboOP•2y ago
Changes too many vanilla features
CtrlAltDelMe
CtrlAltDelMe•2y ago
Nothing wrong with making a vanilla themed server in fabric it's just that paper has more optimizations Oh I see
TommyTimbo
TommyTimboOP•2y ago
or "bugs" depending how you look at it
CtrlAltDelMe
CtrlAltDelMe•2y ago
As a general optimization tip have you disabled something called sync chunk writes in the server.properties? Disabling that is suggested Because having it on true gives perf issues or slow chunk loading
TommyTimbo
TommyTimboOP•2y ago
It is set to true currently. What is the downside to turning it off I'm a bit confused you said 128M for xms and i said 2000M and then you inquired why only 2gb
CtrlAltDelMe
CtrlAltDelMe•2y ago
None tbh 2000mb is aprox 2gb
TommyTimbo
TommyTimboOP•2y ago
right right so why set it to 128m
CtrlAltDelMe
CtrlAltDelMe•2y ago
There's more downs than ups Well There's not lots of diff really When xms is at a low value, the Minecraft process will only allocate the amount of memory it needs & not all of the xmx. This is generally how everyone configures these flags & the rest is reserved You should be able to alocate 3250MB At xmx
TommyTimbo
TommyTimboOP•2y ago
Ahhhhh, gotcha. A thread i was reading said to split it down the middle 2000M 2000M and said that the XMX is how much it "climbs by"
CtrlAltDelMe
CtrlAltDelMe•2y ago
Uh I don't think it works like that? ^ don't try 3500 idk if your host gives overhead Enviro does
TommyTimbo
TommyTimboOP•2y ago
Alright I'm going to slap this bad boy in #!/bin/bash java -Xms128M -Xmx3250M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar fabric.jar --nogui
CtrlAltDelMe
CtrlAltDelMe•2y ago
The bin Bash is not needed That's used if you have got the startup in an sh file If you have spark you can run /spark health And see stuff like tps and memory usage
TommyTimbo
TommyTimboOP•2y ago
I may be blind I don't see a bin bash ooops top line is the --nogui line needed? i don't really understand it
CtrlAltDelMe
CtrlAltDelMe•2y ago
Nah Nogui & the bin/bash is not needed
TommyTimbo
TommyTimboOP•2y ago
Server unable to run
CtrlAltDelMe
CtrlAltDelMe•2y ago
Did you changed the jar name in the flags? Look at the end it is calling to fabric.jar Make sure they've got the same name
TommyTimbo
TommyTimboOP•2y ago
it is. is 128M enough to start the server?
CtrlAltDelMe
CtrlAltDelMe•2y ago
Give me a sec
CtrlAltDelMe
CtrlAltDelMe•2y ago
java -Xms128M -Xmx3250M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar fabric.jar
Aikar's Thoughts
JVM Tuning: Optimized G1GC for Minecraft - Aikar's Thoughts
Learn more about my In depth study on tuning the G1GC garbage collector to be optimized for how Minecraft servers run, and keep low pause efficient usage.
CtrlAltDelMe
CtrlAltDelMe•2y ago
These flags are from the Akair docs Try these
TommyTimbo
TommyTimboOP•2y ago
Still a no go. Here's the crash log
Admincraft Meta
Admincraft Meta•2y ago
Please use a paste service instead!
Paste services are more mobile friendly and easier to read than just posting a log file
Requested by tommytimbo#0
CtrlAltDelMe
CtrlAltDelMe•2y ago
Try a lower xmx 2500M
TommyTimbo
TommyTimboOP•2y ago
No go
CtrlAltDelMe
CtrlAltDelMe•2y ago
.. hmm Well try to use no flags. Just the java -Xms128M -Xmx2500M -jar fabric.jar For testing The server is shutting down with no crash report or whatsoever lol Does the panel says anything?
TommyTimbo
TommyTimboOP•2y ago
17:44:59 Error: Could not find or load main class java Caused by: java.lang.ClassNotFoundException: java
CtrlAltDelMe
CtrlAltDelMe•2y ago
Even with these?
TommyTimbo
TommyTimboOP•2y ago
Yes Would you be down to hop on a call? i understand if not
CtrlAltDelMe
CtrlAltDelMe•2y ago
I'm sorry, I am not native English;-;
TommyTimbo
TommyTimboOP•2y ago
no worries friend
CtrlAltDelMe
CtrlAltDelMe•2y ago
I think you should ask your host? Maybe Something happened to their java docker?
TommyTimbo
TommyTimboOP•2y ago
the additional java options section is where i have been adding them. I have also been changing the memory limit the what the xmx is Prior to this I had the memory limit at 4000M and nothing in the additional java options section
CtrlAltDelMe
CtrlAltDelMe•2y ago
Ohh Wait a second
TommyTimbo
TommyTimboOP•2y ago
I'm not used to this panel at all. Much more difficult than things were 10years ago
CtrlAltDelMe
CtrlAltDelMe•2y ago
It's a weird panel I prefer ptero
ProGamingDk
ProGamingDk•2y ago
amp is interesting it has some cool features tho
CtrlAltDelMe
CtrlAltDelMe•2y ago
Does amp (your panel) has a different place to type in the server jar? Like maybe in the additional java options thing we're not supposed to type xmx and such
TommyTimbo
TommyTimboOP•2y ago
I've been going through each menu and do not see anywhere else
CtrlAltDelMe
CtrlAltDelMe•2y ago
Just out of curiosity do you know how does amp knows the name of the server jar?
TommyTimbo
TommyTimboOP•2y ago
No description
CtrlAltDelMe
CtrlAltDelMe•2y ago
Ahhh Alright try this Wh Eh Wrong paste
CtrlAltDelMe
CtrlAltDelMe•2y ago
-Xms128M -Xmx3250M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true
Aikar's Thoughts
JVM Tuning: Optimized G1GC for Minecraft - Aikar's Thoughts
Learn more about my In depth study on tuning the G1GC garbage collector to be optimized for how Minecraft servers run, and keep low pause efficient usage.
CtrlAltDelMe
CtrlAltDelMe•2y ago
If it still fails remove xmx. @ProGamingDK can you confirm me if the maximum heap size is xmx?
ProGamingDk
ProGamingDk•2y ago
xmx is maximum ram allowed for the jvm to use
TommyTimbo
TommyTimboOP•2y ago
That one booted up. What did you change
ProGamingDk
ProGamingDk•2y ago
although jvm overhead goes over xmx
CtrlAltDelMe
CtrlAltDelMe•2y ago
Ahh I removed the -jar fabric.jsr
TommyTimbo
TommyTimboOP•2y ago
What does JVM mean?
CtrlAltDelMe
CtrlAltDelMe•2y ago
Because the panel already does that Java Virtual machine
ProGamingDk
ProGamingDk•2y ago
Java virtual machine
TommyTimbo
TommyTimboOP•2y ago
Java virtual machine? lol
CtrlAltDelMe
CtrlAltDelMe•2y ago
Jynx
ProGamingDk
ProGamingDk•2y ago
yes
TommyTimbo
TommyTimboOP•2y ago
Okay so it looks like the server is using about .8GB less than it was before with 1 person on. will have to test with more people later
CtrlAltDelMe
CtrlAltDelMe•2y ago
8 GB less? Doesn't the panel have only 4 gb? An .8 Woah I have some good reading skills Ay about the spark thing It is a mod !spark
Carl-bot
Carl-bot•2y ago
Spark Profiler
Spark can be used to see why your server or client is lagging. https://spark.lucko.me/
From An unknown user
Admincraft Canned Responses
CtrlAltDelMe
CtrlAltDelMe•2y ago
You can dl it here
TommyTimbo
TommyTimboOP•2y ago
before i go. final question. Is it okay to have the "Memory Limit" set to 4000mb and then in the "additional java options" to have the xmx set to 3250m?
CtrlAltDelMe
CtrlAltDelMe•2y ago
Memory limit is the thing at here?
TommyTimbo
TommyTimboOP•2y ago
yes
CtrlAltDelMe
CtrlAltDelMe•2y ago
I guess yeah. I'm pretty sure memory limit just makes sure the overhead doesn't go over 4 gb
TommyTimbo
TommyTimboOP•2y ago
kk I will do more research into spark and get it set up. One issue i havewith this panel is when i manually edit the server.properties it overwrites it on server start so the sync-chunk-writes is back to true for some reason
CtrlAltDelMe
CtrlAltDelMe•2y ago
Can you disable it as an option in.. Here?
TommyTimbo
TommyTimboOP•2y ago
I've looked before and done google searches and can not find antyhing
TommyTimbo
TommyTimboOP•2y ago
No description
TommyTimbo
TommyTimboOP•2y ago
Found the option i believe
CtrlAltDelMe
CtrlAltDelMe•2y ago
Tada It's that
TommyTimbo
TommyTimboOP•2y ago
would be nice to be able to just change the file manually but i guess this is easier for some
CtrlAltDelMe
CtrlAltDelMe•2y ago
Some never worked on a cli or a text Editor @ProGamingDK sorry for pinging do you think this might be correct? I mean it says memory limit so yeah
ProGamingDk
ProGamingDk•2y ago
memory most likely is literally just xmx
CtrlAltDelMe
CtrlAltDelMe•2y ago
Yeah I've thought on that too
TommyTimbo
TommyTimboOP•2y ago
Even with this setting turned off the sync-chunk-writes is still set to true very odd
CtrlAltDelMe
CtrlAltDelMe•2y ago
Try to refresh
TommyTimbo
TommyTimboOP•2y ago
I did multiple times 😐
ProGamingDk
ProGamingDk•2y ago
ask in their support ig
TommyTimbo
TommyTimboOP•2y ago
Will do. Thanks a bunch y'all!
CtrlAltDelMe
CtrlAltDelMe•2y ago
Glad to have helped
ProGamingDk
ProGamingDk•2y ago
^^
PhonicUK
PhonicUK•2y ago
You can change it manaually but the changes have to be imported

Did you find this page helpful?