Aikar's Flags Generator for Minecraft Servers

Aikar’s flags are the JVM garbage-collection settings recommended by the Paper team for Minecraft servers. Enter your RAM and jar file name to get the full start command and a script for Linux or Windows.

Free · runs in your browser · how we estimate

Settings

Or a full path to a specific Java install.
Java heap (-Xms / -Xmx)—

What are Aikar’s flags?

Minecraft servers run on Java, and Java frees unused memory with a garbage collector. With default settings, the collector can pause the whole server for a moment, and players feel those pauses as lag spikes and rubber-banding. Aikar, a long-time Paper developer, tuned Java’s G1 collector for the way Minecraft uses memory: lots of short-lived objects created every tick. His settings, known as Aikar’s flags, keep pauses short and regular. PaperMC’s documentation recommends them for every Paper server.

What the main flags do

FlagWhat it does
-Xms / -XmxThe starting and maximum memory for the server. Set both to the same value so Java reserves it all at startup.
-XX:+UseG1GCUses the G1 garbage collector, which works in small regions and keeps pauses short.
-XX:MaxGCPauseMillis=200Asks the collector to keep each pause under 200 ms.
-XX:G1NewSizePercent / G1MaxNewSizePercentReserves a large part of memory for new, short-lived objects, which is how Minecraft creates most of its data.
-XX:+AlwaysPreTouchTouches all the memory at startup so the system doesn’t have to hand it over during play.
-XX:+DisableExplicitGCIgnores plugins that ask Java to run a full garbage collection, which would freeze the server.
-XX:MaxTenuringThreshold=1Moves objects that survive one collection out of the young area quickly, keeping young collections fast.

How much memory to give the server

Don’t give Java all the RAM your machine has. Java itself, the operating system and any other programs need room too. PaperMC’s advice is to leave about 1,000–1,500 MB free: on a machine or VPS with 8 GB, use about 6.5 GB for the server. Tick “Leave 1.5 GB for the system” above to do this automatically.

On a game host, the plan’s RAM is usually what the server is allowed to use, and the host’s panel already sets -Xmx. Many hosts have an “Aikar’s flags” option or a field for extra startup flags in their panel.

Above 12 GB, Aikar’s original guide changes a few values (a larger young generation and 16 MB regions). The generator switches to those automatically. More memory isn’t always better, though: past what your server needs, a bigger heap just means larger, slower collections.

How to use the script

  1. Put start.sh or start.bat in the same folder as your server jar.
  2. On Linux or macOS, make it executable once with chmod +x start.sh, then run ./start.sh.
  3. On Windows, double-click start.bat.
  4. Use the Java version your Minecraft version needs: Minecraft 26.1 and newer need Java 25, and 1.20.5 to 1.21.x need Java 21.

Frequently asked questions

What are Aikar's flags?
A set of Java garbage-collector (G1GC) settings tuned for Minecraft by Aikar, a Paper developer. They reduce the long pauses that cause lag spikes, and PaperMC’s documentation recommends them for Paper servers.
Do Aikar's flags work with Vanilla, Fabric and Forge?
Yes. They’re Java settings, so they work with any Java Edition server software. They were tuned on Paper but help other server types too.
Should -Xms and -Xmx be the same?
Yes. PaperMC recommends setting both to the same value so the server reserves its memory at startup instead of growing the heap while running.
How much RAM should I give the server?
Leave room for the operating system and Java’s own overhead: about 1–1.5 GB less than the machine or plan has. Many hosts already account for this, so use the amount your host’s panel suggests.
Can I use these flags on a hosted server?
Many hosts let you edit startup flags or choose an “Aikar’s flags” option in their control panel. Some apply them automatically.