Aikar's flags: the JVM startup flags, explained

The current Paper-published Aikar's flags string, the over-12 GB variant, what each flag changes against Java 25 defaults, and how to check it helped.

Omne TeamUpdated Nov 17, 20267 min read

Quick answer Aikar’s flags are one long line of JVM options that make Java’s G1 garbage collector start work earlier and give new objects more room, because Minecraft allocates memory very fast [2]. They do not raise TPS; what they aim at is shorter garbage collection pauses [1][2], which I did not measure. They are worth using on a Paper server with roughly 6 to 10 GB or more of heap [1]. Below that, skip them and fix plugins and settings first. The exact string is below. If your heap is over 12 GB, there is a different set of five values.

The string, as Paper publishes it

This is the current text of the PaperMC docs page, which says “Last updated: Sep 18, 2026” [1]. It is one command, wrapped below for width, so join the lines with single spaces on one line in a panel field.

java -Xms10G -Xmx10G -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 -jar paper.jar --nogui

Change -Xms and -Xmx, and nothing else. Keep them equal, and keep them below your host’s memory limit: Paper says to reduce both by about 1000 to 1500 MB, so 8 GB of host memory means about 6500 MB [1]. Paper’s own example heap is 10G, which would not fit a 10 GB plan. The reasoning is in the RAM sizing post.

Over 12 GB of heap

Aikar’s original article, last updated April 25, 2020, has a second set for an Xmx “greater than 12G”. Change five values from the string above [2]:

Flag Base string Over 12G
G1NewSizePercent 30 40
G1MaxNewSizePercent 40 50
G1HeapRegionSize 8M 16M
G1ReservePercent 20 15
InitiatingHeapOccupancyPercent 15 20

The PaperMC page I read does not repeat this variant, so the source for it is dated April 2020, well before the base string was last updated. Past 10 GB, Paper’s own warning is that more memory does not mean better performance above a certain point [1]. Be sure you need the big heap before you tune it.

What each flag changes

Aikar wrote that Minecraft allocates “at least 800 Megabytes a second on a 30 player server” [2]. My reading of the numbers below is that the string is built around that: a larger young generation and earlier concurrent marking, so the collector keeps up.

The Java 25 default column comes from the JDK 25 documentation [3]. Rows marked “measured” are not on Oracle’s page, so I read them from java -XX:+PrintFlagsFinal on Temurin 25.0.3 on November 17, 2026.

Flag Aikar Java 25 default What it does
UseG1GC on on (G1 is the default) [3] Selects G1. Redundant on Java 25.
MaxGCPauseMillis 200 200 for G1 [3] A soft pause goal. Same as the default, so this line restates it.
G1NewSizePercent 30 5 [3] Minimum young generation size, as a percent of the heap.
G1MaxNewSizePercent 40 60 [3] Maximum young generation size. Lower than the default.
G1HeapRegionSize 8M set from heap size, aiming at about 2048 regions [3] Region size, a power of 2 from 1 to 32 MB.
G1ReservePercent 20 10 [3] Heap reserved to reduce promotion failures.
InitiatingHeapOccupancyPercent 15 45 [3] Old generation fullness at which concurrent marking starts. Earlier here.
G1MixedGCCountTarget 4 8 [3] Target number of mixed collections after a marking cycle.
G1MixedGCLiveThresholdPercent 90 85 [3] Occupancy threshold for old regions to join a mixed collection.
G1HeapWastePercent 5 5 [3] Same as default.
SurvivorRatio 32 8 [3] Ratio of eden to survivor space size.
G1RSetUpdatingPauseTimePercent 5 10 (measured; Paper also says 10% [1]) Share of pause time spent updating remembered sets. Paper says lowering it makes more of that work concurrent, to shorten pauses [1].
MaxTenuringThreshold 1 15 (measured) How many young collections an object survives before promotion to the old generation. Paper’s aim is to stop short-lived data being promoted [1].
PerfDisableSharedMem on off (measured) Paper’s note says the default behavior can cause major latency when disk IO is high [1]. I did not verify that mechanism.
DisableExplicitGC on off [3] Ignores calls to System.gc(). The JVM still collects when it needs to [3].
AlwaysPreTouch on off [3] Touches every heap page at startup, so the memory is claimed up front [3].
ParallelRefProcEnabled on on when more than one GC thread [3] Parallel reference processing.
UnlockExperimentalVMOptions on off [3] Needed because G1NewSizePercent, G1MaxNewSizePercent and G1MixedGCLiveThresholdPercent are experimental flags [3].

The two -D entries at the end set system properties and are not tuning flags; neither Paper’s page nor Oracle’s explains what reads them, and the JVM accepts them without complaint.

Two things stand out. First, on Java 25 the string mostly moves values away from defaults rather than adding capability: a bigger young generation, earlier marking, bigger reserve. Second, DisableExplicitGC is the one that changes behavior toward plugins. A plugin that calls System.gc() is ignored, so it cannot force a collection on its own. The PaperMC page explains AlwaysPreTouch as getting the memory set up and reserved at process start [1]; it also means the process claims its whole heap at boot, even on an empty server.

Did the JVM accept it

I ran the full Paper string, with -Xms1G -Xmx1G and a GC log added, on a JDK 25.0.3 JVM using java -version as the program. It exited normally with no warnings. That is all I verified. I have not run it on a live Paper server and I have no before-and-after numbers, so I am not claiming any improvement.

A flag a JVM does not know is a hard failure, not a warning. This is the real text from a made-up flag:

Unrecognized VM option 'NotARealFlag'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Old guides show flags from older Java versions. -XX:+UseConcMarkSweepGC fails the same way on Java 25 in my test, and Oracle’s JDK 25 page lists -Xloggc as deprecated [3]. Use the Java 11+ logging flag below, not the Java 8 one.

How to tell whether the flags helped

Turn on a GC log. Paper’s page gives this Java 11+ string [1]:

-Xlog:gc*:logs/gc.log:time,uptime:filecount=5,filesize=1M

Put it before -jar, make sure the logs folder exists, and let the server run through a busy period. The first lines of the log confirm what the JVM actually applied. From my test run (example, your values will differ):

Using G1
Heap Region Size: 8M
Pre-touch: Enabled

Pause lines look like this, from a small test program, not a Minecraft server:

GC(0) Pause Young (Normal) (G1 Evacuation Pause) 305M->3M(1024M) 1.440ms

The last figure is the pause. Compare the long pauses against the time your players reported lag. With spark installed, /spark gcmonitor toggles GC monitoring and /spark gc prints GC history [5], so you can check from in game. If spikes do not line up with GC pauses, the flags are not your fix. Diagnosing lag with the spark profiler will tell you what is.

If you are thinking about ZGC instead

Java 25 also has ZGC, which Oracle describes as a low-latency collector with pauses of a few milliseconds at some throughput cost [3]. The wiki calls it “almost lag-free” [4]. I did not test ZGC against these flags for this post, so I make no claim about which is better for a Minecraft server.

Three ways this goes wrong

  1. -Xmx equal to the plan’s memory limit. The container gets killed from outside and the Java log just stops. Lower the heap by 1000 to 1500 MB [1].
  2. A stray character in the pasted string. Join the lines with single spaces. If the server will not start and the console shows Unrecognized VM option or Could not create the Java Virtual Machine, look for a split or mangled flag.
  3. Copying Java 8 flags. Old guides add flags for old collectors. Paper’s page splits its logging flags by Java version [1], and Minecraft 26.1 and later needs Java 25 [4].

I did not check how every panel exposes the Java arguments field. Look for the startup command, then confirm with the GC log header above.

What I did not verify

I did not measure garbage collection behavior on a real server with and without these flags. I did not verify what reads the two -D properties or Paper’s explanation of PerfDisableSharedMem. The over-12 GB values come from a 2020 article, and Paper’s current page does not list them.

Questions people ask

Do these flags increase TPS?

No. They change how Java's garbage collector schedules its work, so the aim, per Paper and Aikar, is fewer or shorter pauses, not a higher baseline tick rate [1][2]. I did not measure that. If your spikes do not line up with garbage collection pauses, the flags will not help.

Can I use these flags on a small server with 2 to 4 GB?

You can, but both the PaperMC page and Aikar's article say at least 6 to 10 GB [1][2], and Oracle's JDK 25 documentation recommends G1 for large heaps of around 6 GB or larger [3]. Below that, I would start with Java's defaults and add flags only if a measurement says to.

What do I change in the string?

Only -Xms and -Xmx. Paper's example uses 10G for both, so on a plan with a 10 GB limit you must lower them to leave headroom [1].

Do the flags still work on Java 25?

I started a JDK 25.0.3 JVM with Paper's full string on November 17, 2026 and it accepted every flag with no warnings. That shows the flags are valid. It does not show a performance benefit, which I did not measure.

Sources

  1. Aikar's flags (PaperMC Docs, last updated Sep 18, 2026)
  2. Aikar: Tuning the JVM, G1GC flags for Minecraft (last updated Apr 25 2020)
  3. The java command, JDK 25 (Oracle)
  4. Tutorial: Setting up a Java Edition server (Minecraft Wiki)
  5. spark command usage