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
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
lavaking462y ago
use aikars flags and xms
lavaking46
lavaking462y ago
https://flags.sh also helps
flags.sh
flags.sh
A simple script generator to start your Minecraft servers with optimal flags.
TommyTimbo
TommyTimboOP2y ago
I'll give it a go. Should I be adding them to the "additional java options" section
No description
lavaking46
lavaking462y ago
probably. i'm not entirely familiar with that panel
TommyTimbo
TommyTimboOP2y ago
👍 no problem. will do some testing and report back. this site is very helpful
lavaking46
lavaking462y ago
yep
1who¡ssus?
1who¡ssus?2y ago
Where are you seeing the memory usage? @TommyTimbo
TommyTimbo
TommyTimboOP2y ago
I just stopped the server and with no one online the memory was at 3.09/3.91
No description
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y ago
Sure thing. Whats the reasoning? I see it being used in most recommended startups
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y ago
Will Spark be useful to me if I don't understand the java classes in the heap dumps?
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y ago
The other night with 3 people online we ran oom 3 times with a view distance of 8.
1who¡ssus?
1who¡ssus?2y ago
If you had alwayspretouch it might have been that It might ™
TommyTimbo
TommyTimboOP2y ago
I'm unsure if there are even startup flags right now. This panel is annoying
1who¡ssus?
1who¡ssus?2y ago
You He She 🤭 It's worth removing it & set Xms to 128M
TommyTimbo
TommyTimboOP2y ago
Oh wow okay, I was going to set the xms to 2000m and the xmx to 2000m as well
1who¡ssus?
1who¡ssus?2y ago
Only 2 gb? You guys don't have many mods right?
TommyTimbo
TommyTimboOP2y ago
A few datapacks from Vanilla Tweaks and then optimization plugins
1who¡ssus?
1who¡ssus?2y ago
I see. Plugins? You mean mods?
TommyTimbo
TommyTimboOP2y ago
yes
1who¡ssus?
1who¡ssus?2y ago
May I ask why you guys haven't used paper? Out of curiosity btw
TommyTimbo
TommyTimboOP2y ago
Changes too many vanilla features
1who¡ssus?
1who¡ssus?2y ago
Nothing wrong with making a vanilla themed server in fabric it's just that paper has more optimizations Oh I see
TommyTimbo
TommyTimboOP2y ago
or "bugs" depending how you look at it
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y 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
1who¡ssus?
1who¡ssus?2y ago
None tbh 2000mb is aprox 2gb
TommyTimbo
TommyTimboOP2y ago
right right so why set it to 128m
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y 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"
1who¡ssus?
1who¡ssus?2y ago
Uh I don't think it works like that? ^ don't try 3500 idk if your host gives overhead Enviro does
TommyTimbo
TommyTimboOP2y 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
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y 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
1who¡ssus?
1who¡ssus?2y ago
Nah Nogui & the bin/bash is not needed
TommyTimbo
TommyTimboOP2y ago
Server unable to run
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y ago
it is. is 128M enough to start the server?
1who¡ssus?
1who¡ssus?2y ago
Give me a sec
1who¡ssus?
1who¡ssus?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.
1who¡ssus?
1who¡ssus?2y ago
These flags are from the Akair docs Try these
TommyTimbo
TommyTimboOP2y ago
Still a no go. Here's the crash log
Admincraft Meta
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
1who¡ssus?
1who¡ssus?2y ago
Try a lower xmx 2500M
TommyTimbo
TommyTimboOP2y ago
No go
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y ago
17:44:59 Error: Could not find or load main class java Caused by: java.lang.ClassNotFoundException: java
1who¡ssus?
1who¡ssus?2y ago
Even with these?
TommyTimbo
TommyTimboOP2y ago
Yes Would you be down to hop on a call? i understand if not
1who¡ssus?
1who¡ssus?2y ago
I'm sorry, I am not native English;-;
TommyTimbo
TommyTimboOP2y ago
no worries friend
1who¡ssus?
1who¡ssus?2y ago
I think you should ask your host? Maybe Something happened to their java docker?
TommyTimbo
TommyTimboOP2y 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
1who¡ssus?
1who¡ssus?2y ago
Ohh Wait a second
TommyTimbo
TommyTimboOP2y ago
I'm not used to this panel at all. Much more difficult than things were 10years ago
1who¡ssus?
1who¡ssus?2y ago
It's a weird panel I prefer ptero
ProGamingDk
ProGamingDk2y ago
amp is interesting it has some cool features tho
1who¡ssus?
1who¡ssus?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
TommyTimboOP2y ago
I've been going through each menu and do not see anywhere else
1who¡ssus?
1who¡ssus?2y ago
Just out of curiosity do you know how does amp knows the name of the server jar?
TommyTimbo
TommyTimboOP2y ago
No description
1who¡ssus?
1who¡ssus?2y ago
Ahhh Alright try this Wh Eh Wrong paste
1who¡ssus?
1who¡ssus?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.
1who¡ssus?
1who¡ssus?2y ago
If it still fails remove xmx. @ProGamingDK can you confirm me if the maximum heap size is xmx?
ProGamingDk
ProGamingDk2y ago
xmx is maximum ram allowed for the jvm to use
TommyTimbo
TommyTimboOP2y ago
That one booted up. What did you change
ProGamingDk
ProGamingDk2y ago
although jvm overhead goes over xmx
1who¡ssus?
1who¡ssus?2y ago
Ahh I removed the -jar fabric.jsr
TommyTimbo
TommyTimboOP2y ago
What does JVM mean?
1who¡ssus?
1who¡ssus?2y ago
Because the panel already does that Java Virtual machine
ProGamingDk
ProGamingDk2y ago
Java virtual machine
TommyTimbo
TommyTimboOP2y ago
Java virtual machine? lol
1who¡ssus?
1who¡ssus?2y ago
Jynx
ProGamingDk
ProGamingDk2y ago
yes
TommyTimbo
TommyTimboOP2y 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
1who¡ssus?
1who¡ssus?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-bot2y 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
1who¡ssus?
1who¡ssus?2y ago
You can dl it here
TommyTimbo
TommyTimboOP2y 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?
1who¡ssus?
1who¡ssus?2y ago
Memory limit is the thing at here?
TommyTimbo
TommyTimboOP2y ago
yes
1who¡ssus?
1who¡ssus?2y ago
I guess yeah. I'm pretty sure memory limit just makes sure the overhead doesn't go over 4 gb
TommyTimbo
TommyTimboOP2y 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
1who¡ssus?
1who¡ssus?2y ago
Can you disable it as an option in.. Here?
TommyTimbo
TommyTimboOP2y ago
I've looked before and done google searches and can not find antyhing
TommyTimbo
TommyTimboOP2y ago
No description
TommyTimbo
TommyTimboOP2y ago
Found the option i believe
1who¡ssus?
1who¡ssus?2y ago
Tada It's that
TommyTimbo
TommyTimboOP2y ago
would be nice to be able to just change the file manually but i guess this is easier for some
1who¡ssus?
1who¡ssus?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
ProGamingDk2y ago
memory most likely is literally just xmx
1who¡ssus?
1who¡ssus?2y ago
Yeah I've thought on that too
TommyTimbo
TommyTimboOP2y ago
Even with this setting turned off the sync-chunk-writes is still set to true very odd
1who¡ssus?
1who¡ssus?2y ago
Try to refresh
TommyTimbo
TommyTimboOP2y ago
I did multiple times 😐
ProGamingDk
ProGamingDk2y ago
ask in their support ig
TommyTimbo
TommyTimboOP2y ago
Will do. Thanks a bunch y'all!
1who¡ssus?
1who¡ssus?2y ago
Glad to have helped
ProGamingDk
ProGamingDk2y ago
^^
PhonicUK
PhonicUK2y ago
You can change it manaually but the changes have to be imported

Did you find this page helpful?