Skip to content

Enabling Aikar's Flags On Your Server

By default, AleForge enables a large portion of these optimizations. On demanding servers, we do recommend contacting our support to apply the full optimizations. Contact our support today to get your server running optimally.

java -Xms128M -Xmx$(({{SERVER_MEMORY}}*84/100))M -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 -Dterminal.jline=false -Dterminal.ansi=true $(([[ -f {{SERVER_JARFILE}} ]] && printf %s "-jar {{SERVER_JARFILE}}") || (printf "@libraries/net/minecraftforge/forge/`ls libraries/net/minecraftforge/forge/ | sort -nr | awk 'NR==1'`/unix_args.txt"))

Total server memory is reduced due to JVM overhead to prevent your server from running out of memory.

AleForge recommends using at least 6GB of ram with 10GB being preferable. Having at least this much memory will ensure your Minecraft server will run efficiently.

Memory Greater than 12GB

Contact AleForge support to have the below values changed:

  • -XX:G1NewSizePercent=40
  • -XX:G1MaxNewSizePercent=50
  • -XX:G1HeapRegionSize=16M
  • -XX:G1ReservePercent=15
  • -XX:InitiatingHeapOccupancyPercent=20

Why these changes?

  • The base flag set aims for 30/40 to reduce the risk of space issues. With more memory, it is less of an issue. We can give more to the new generation with 40/50 and reduce the reserve percentage since the default reserve will already be larger.
  • Region Size increase helps reduce humongous allocations and speeds up remarking. We need a smaller region size at smaller heaps to ensure adequate regions are available.
  • We can start looking for old-generation memory to reclaim with more of a delay with IHOP at 20 since we have more old-generation available to space on the CPU.

More Details

For more information on Aikar’s flags, please read this guide.