How to Use Aikar Flags for Better Minecraft Server Performance

Minecraft servers are one of the most popular ways to enjoy multiplayer. Through the use of a server, players from all over the world can connect and play with each other.

However, as more people join a server, the load begins to increase and slowdowns can occur in the form of server lags and pauses. One of the best ways to mitigate this problem is to tune the server to improve performance.

This article specifically explains how to install Aikar’s garbage collection flags to improve server performance.


Aikar Java Flags for Minecraft Server Performance: How to Install Them

Why should players use Aikar Flags for a Minecraft server?

The developers of Paper, which is currently the most popular brand of Minecraft servers, recommend all server owners to use Aikar Flags. These flags have been refined over the years with extensive data to provide server owners with the best experience.

In technical terms, these flags help speed up garbage collection, which is an essential process for all Java-based applications to work properly. Without garbage collection, the server would run out of RAM and experience an out of memory error and crash. However, garbage collection itself can slow down a server if it uses the wrong settings, which is where Aikar flags come in.

Hi, may I draw the Mojang team’s attention to Aikar’s Java flags? the new MC update killed the performance for me, the game is unplayable. I was able to run the game at ~60 fps by running the game with Aikar’s flags! (check answer) @kingbdogz

How to use Aikar flags?

Using Aikar Flags is relatively simple and requires only a few adjustments depending on the brand of server used and the amount of memory (RAM) allocated to the server instance.

For those using Paper with less than 12 GB of RAM, they can use the following flags for their server:

java-XmsG-XmxG -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX: InitiatingHeapOccupancyPercent=20 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar .jar nogui

For those using Paper with more than 12 GB of RAM, they can use the following flags for their server:

java-XmxG-XmxG -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX: InitiatingHeapOccupancyPercent=20 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar .jar nogui

To check if the flags are working properly, server administrators using a dedicated server can simply check the running processes with the “htop” command. If everything was executed correctly, a process using the same set flags will be clearly visible.


Profile Picture