Skip to content

Aikar's flags on Minecraft servers

Aikar's flags are JVM startup parameters that tune Java's garbage collector for smoother Minecraft performance. berrybyte applies them by default on Paper, Spigot, and Fabric servers, so 100% RAM usage in the dashboard is normal, not a problem.

Aikar's flags are a set of JVM startup parameters that tune Java's garbage collector for Minecraft, trading a bit of memory headroom for shorter, more predictable pauses and fewer lag spikes. berrybyte applies them automatically on every Paper, Spigot, and Fabric-family Java server, so there is nothing for you to configure.

Why does my server show 100% RAM usage?

This is expected and not a sign of trouble. Aikar's flags set -Xms and -Xmx (initial and maximum heap) to the same value, so the JVM reserves your server's full memory allocation the moment it starts, rather than growing into it as the world loads. The dashboard reports that reservation, not how much memory the game is using at any given moment.

If you want a real usage number instead of the full allocation, the Spark plugin below reports it directly.

How do I check my server's real memory usage?

Install Spark

Add the Spark plugin from Overview → Plugins → Manage plugins (search "spark"), or download it from spark.lucko.me and upload the jar to Files → plugins.

Run the health check

From the server console, or in-game as an operator, run /spark health.

Read the report

Spark shows heap and process memory in real time, which is the number to watch instead of the dashboard's allocation figure.

What do Aikar's flags do?

berrybyte handles this for you, but here is what's running under the hood on a Paper, Spigot, or Fabric-family server:

FlagWhat it does
-Xms / -XmxSets the initial and maximum heap to the same value, avoiding pauses while the JVM resizes memory mid-game
-XX:+UseG1GCEnables the G1 garbage collector, tuned for short, predictable pauses over raw throughput
-XX:+ParallelRefProcEnabledProcesses reference queues (weak and soft references) in parallel instead of blocking the main GC thread
-XX:MaxGCPauseMillis=200Targets a 200ms upper bound for each garbage collection pause
-XX:+DisableExplicitGCIgnores System.gc() calls from poorly written plugins that would otherwise force a full collection
-XX:G1NewSizePercent / -XX:G1MaxNewSizePercentControls how much heap is reserved for short-lived objects like entities and dropped items
-XX:SurvivorRatio=32Tunes how objects move between young-generation survivor spaces before promotion

The full command berrybyte runs looks like this:

Applied automatically, no action needed
-Xms{MEMORY}M -Xmx{MEMORY}M -XX:+UseG1GC -XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC \
-XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M \
-XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 \
-XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem \
-XX:MaxTenuringThreshold=1

This tuning applies to Paper, Spigot, and Fabric-family Java software. Forge and NeoForge modpacks use a different memory profile that berrybyte tunes automatically for the loader.

How do I add Aikar's flags manually?

This section is for anyone running Minecraft on their own machine, a VPS, or another host, not a berrybyte server. berrybyte applies these flags automatically, so if you host with us there is nothing to set up.

Adding the flags means replacing your normal java -jar server.jar command with a longer one that includes them. Pick the version below that matches how much RAM you're giving the server, swap in your jar's filename, and use that as your start command from now on.

Decide how much RAM to give the server

Use the same number for both -Xms and -Xmx below, in megabytes. Leave about 1GB of the machine's total RAM free for the operating system and Java itself, so on an 8GB machine you'd give the server 7168.

Grab the matching command

There are two versions below: one for servers under 12GB of RAM, one for 12GB and up. Copy the one that matches.

Swap in your jar name

Replace paper.jar with whatever your actual server file is called. Keep --nogui; it stops Java from opening a separate window.

Save it as your start command

Put the finished line in start.sh (Linux, macOS) or start.bat (Windows) next to your server jar, and run that file to start the server from now on.

Server has less than 12GB RAM
java -Xms7168M -Xmx7168M -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
Server has 12GB RAM or more
java -Xms12288M -Xmx12288M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -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

The two commands are almost identical. Only these five numbers change based on how much RAM you're giving the server:

SettingUnder 12GB12GB or more
G1NewSizePercent3040
G1MaxNewSizePercent4050
G1HeapRegionSize8M16M
G1ReservePercent2015
InitiatingHeapOccupancyPercent1520

Running inside a container or a VPS with a strict memory limit? Remove -XX:+AlwaysPreTouch from the command. It grabs all the RAM upfront, which can get the process killed if the container enforces a hard cap.

Make sure the Java version installed matches what your Minecraft version needs. Recent Paper builds want Java 21; an older Java install will refuse to start the server.

Hosting with berrybyte instead? Settings → Startup shows your server's fully resolved startup command with a copy button, and lets you pick the Java version. It's read-only, since berrybyte already applies this tuning for you. Need something custom? Open a support ticket.

If players are getting dropped rather than just seeing lag, that's usually a different issue: see Fix 'Connection timed out'. For a wider look at server management, head back to the Minecraft hub.

Frequently asked questions

Why does my Minecraft server always show 100% RAM usage?

Aikar's flags set the minimum and maximum heap to the same value, so the JVM claims all of it upfront instead of resizing under load. The dashboard shows that full allocation, not how much memory your world is using.

Do I need to set up Aikar's flags myself?

Not on berrybyte. They are applied automatically on every Paper, Spigot, and Fabric-family Java server. Add them by hand only when you run a server yourself elsewhere, covered in the manual section on this page.

How do I check my Minecraft server's actual memory usage?

Install the Spark plugin from Overview → Plugins → Manage plugins, then run /spark health from the console or in-game as an operator. It reports real heap usage instead of the full allocation the dashboard shows.

What garbage collector do Aikar's flags use?

G1GC (Garbage-First), tuned with a target pause time of 200ms and a set of region and heap-occupancy thresholds that keep collections short and predictable.

Can I edit the startup command on a berrybyte server?

The startup command is shown read-only under Settings → Startup, where you can also pick the Java version and copy the resolved command. Open a support ticket if your server needs a custom one.

How do I manually add Aikar's flags to my Minecraft server?

Replace your java -jar start command with one that includes the flags, picking the version sized for your server's RAM (under 12GB, or 12GB and up). The full commands and a step-by-step breakdown are in the manual section on this page.

Start a game
server in seconds

Join the Discord

91 servers started with berrybyte this week