Aikar's JVM Flags for Minecraft Servers Explained

What Aikar's flags are, why they improve Minecraft server performance, and how to apply them via the panel Startup tab.

Aikar's flags are a community-maintained set of JVM (Java Virtual Machine) arguments that optimize garbage collection for Minecraft servers. They're considered the gold standard for server performance and reduce TPS lag spikes by 50–80% on most setups.

What They Do

OptimizationEffect
Switch to G1GCReplaces Java's default garbage collector with one designed for low-pause workloads
Reduce GC pause timesEliminates the periodic stutters caused by full garbage collection
Optimize allocationTunes new-generation sizing for Minecraft's allocation patterns
Pre-touch memoryAllocates and touches all memory at startup so the OS doesn't reclaim it
Disable explicit GCPrevents poorly-written plugins from triggering full GCs manually

Apply Aikar's Flags

Open Startup

In the XGamingServer Panel, click Startup in the sidebar.

Find the JVM Flags field

Look for JVM Flags, Additional Java Arguments, or Java Options — the exact label varies. This is where startup JVM arguments go.

Paste the flags

Copy the appropriate flag set below (depending on your RAM allocation) and paste it into the field.

Restart the server

Restart from Console. The new flags take effect immediately.

The Flags

For Servers with 12 GB RAM or Less

-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -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

For Servers with More Than 12 GB RAM

Use the same flags but change these two values:

-XX:G1NewSizePercent=40
-XX:G1MaxNewSizePercent=50

This is because larger heaps benefit from a bigger young generation.

Verify the Flags Are Active

In the Console, look for the startup log. With Aikar's flags applied, you should see:

[main/INFO] Starting net.minecraft.server.Main
[main/INFO] [System Property] using.aikars.flags = https://mcflags.emc.gs
[main/INFO] [System Property] aikars.new.flags = true

The two using.aikars.flags and aikars.new.flags properties confirm the flags loaded correctly.

Do They Actually Help?

Yes — measurably. The biggest improvement is reducing TPS lag spikes caused by JVM garbage collection pauses. Without these flags, you'll see periodic stutters every 30 seconds to a few minutes. With them, GC happens incrementally and players don't notice.

Common before/after:

Without Aikar'sWith Aikar's
GC pause: 200–500 ms every minuteGC pause: 20–50 ms every few seconds
TPS dips to 15 during GCTPS stays at 19.5+ during GC
Players see "rubber banding" during pausesSmooth gameplay

Common Mistakes

MistakeWhy It's Wrong
Over-allocating RAMGiving 16 GB to a 4-player server makes GC pauses worse, not better. Match RAM to actual need
Mixing GC flagsDon't use Aikar's flags AND -XX:+UseConcMarkSweepGC or other GC settings — they conflict
Using old CMS collector-XX:+UseConcMarkSweepGC is the legacy CMS collector that Aikar's flags specifically replace
Forgetting -Xms = -XmxMin and max heap should match, e.g. -Xms6G -Xmx6G. Different values cause runtime resizing overhead

Java Version Notes

Aikar's flags work on Java 8, 17, and 21. The G1 collector is available in all modern Java versions. No flag changes are needed across Java upgrades.

Reference

How is this guide?

40% Off — Limited TimeGet your Minecraft server todayInstant setup, DDoS protection, and 24/7 support included.
Get a Server

On this page