# 🚀 Java Arguments Guide

This guide covers how to properly structure Java startup arguments when configuring your server through the Expanse Panel.


# 💡 What are Java Arguments?

Java arguments are flags you pass to the Java Virtual Machine (JVM) to control behavior such as memory usage, garbage collection, performance tuning, and more. They can significantly impact your server’s performance — for better or worse.


# Why Stick With the Default?

Expanse uses Aikar’s recommended flags out of the box. These arguments are:

  • Optimized for Minecraft servers
  • Widely used and trusted in the community
  • Balanced for both performance and stability

If you're unsure what a flag does, we strongly recommend keeping the default setup.


# 🔧 How to Change Java Arguments

  1. Log in to the Expanse Panel
  2. Select your server from the Servers list
  3. Navigate to the Startup tab
  4. Locate the Java Arguments field
  5. Modify the arguments as needed and save

# 🔁 Common Java Arguments (just copy and paste)

Aikar's Flags (default) - Uses G1GC

--add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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

Hilltty's flags (Github) - Uses ShenandoahGC

--add-modules=jdk.incubator.vector -XX:+UseLargePages -XX:LargePageSizeInBytes=2M -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:+UseNUMA -XX:+AlwaysPreTouch -XX:-UseBiasedLocking -XX:+DisableExplicitGC -Dfile.encoding=UTF-8

ZGC (Github) - Uses ZGC

--add-modules jdk.incubator.vector -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+ZGenerational -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:+PerfDisableSharedMem -XX:+UseStringDeduplication -XX:+UseTransparentHugePages -XX:+ParallelRefProcEnabled -XX:+EnableDynamicAgentLoading -Dfile.encoding=UTF-8