Minecraft Aikar's Flags Generator
Pick the heap size you want Java to use and get Aikar's flags, ready to paste into your startup command or download as a script for Linux or Windows. Works for any Paper, Spigot, Purpur, Fabric or Forge server, not just ours.
Standard preset: this switches to the large-heap tuning automatically at 12 GB. Xms is set equal to Xmx, 30% new-gen sizing.
java -Xms6144M -Xmx6144M -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 -jar server.jar noguiWhat these flags do
Aikar's flags retune the G1 garbage collector's region size and thresholds for the way Minecraft allocates memory: lots of short-lived objects with occasional big spikes when chunks or entities load. The result is shorter, more frequent pauses instead of the multi-second freeze a default JVM eventually hits.
They are not free insurance on a tiny server: below about 4 GB of heap there is not enough room for the tuning to do anything, so a plain -Xmx line does just as well.
FAQ
A set of JVM startup flags, named after the Paper and Spigot developer who put them together, that retune the G1 garbage collector for how Minecraft allocates memory. They trade a few extra small pauses for far fewer of the long ones that show up as a rubber-band freeze.
A bigger heap works better with bigger G1 regions and different new-generation sizing, so the 12 GB and up preset raises the region size to 16 MB and shifts a few of the percentages. This generator switches automatically once the heap is 12 GB or more.
Yes. Setting the minimum and maximum heap equal stops Java resizing the heap while the server runs, which is itself a pause. This generator always sets Xms to match Xmx, for example -Xms6144M -Xmx6144M for a 6 GB heap.
Probably not. Aikar's flags suit heaps of about 4 GB and up, and Paper's own guidance is 6 GB or more no matter the player count. A heap that small does not give G1GC enough room to use the tuning, so a plain -Xms2G -Xmx2G line does about as well.
Yes. Every Minecraft server we host launches with Aikar's flags and a heap sized to your plan automatically, so there is nothing to paste in. This tool is here for a self-hosted server, or one on another host.