© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
AdmincraftA
Admincraft•9mo ago•
1 reply
Ethonodon

Reducing garbage collector lag?

I'm running a modded 1.18.2 Forge server, and ever since removing Valkyrien Skies, Eureka, and Create: Clockwork (they had a memory leak), the server has been consistently lagged every 5 minutes by the GC. It does this even when the memory usage is not high. There could only be one person online, and it'll start the GC exactly every 5 minutes and lag the server even when ram usage is only around 2-3gb. How do I prevent this? I have several optimization mods like ferritecore, and am using Aikar's flags, so I don't know what else I could do to mitigate this GC lag. I've ran plenty of modded servers in the past, and have never encountered rhythmic GC lag like this.

Startup flags:
java -Xms6500M -Xmx6500M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+UseContainerSupport -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 -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s "-jar server.jar" || printf %s "@unix_args.txt" )
java -Xms6500M -Xmx6500M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+UseContainerSupport -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 -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s "-jar server.jar" || printf %s "@unix_args.txt" )



https://spark.lucko.me/YymH3xgOdi
AdmincraftJoin
10,704Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Problems with Garbage Collector and TPS Spikes
AdmincraftAAdmincraft / questions
2y ago
any tips for reducing vill lag
AdmincraftAAdmincraft / questions
13mo ago
Reducing Lag from flying machines/auto farms
AdmincraftAAdmincraft / questions
12mo ago
is tweaking the bukkit chunk garbage collector a good idea
AdmincraftAAdmincraft / questions
15mo ago