Using Aikar's flags

Aikar's flags are a great way to optimize your Minecraft server's performance, and will allow you to squeeze out every last drop of performance from your CPU and RAM. In this article, we will discuss what Aikar's flags are, how they work, and how you can apply them to your server.

Aikar's flags are an optimized set of flags that can increase your server's performance with little effort on your part. By default, Java's garbage collector is not optimized for running Minecraft servers, but Aikar's flags is a set of tuned flags that is specifically designed for running Minecraft servers. These flags will reduce your server's pause times due to garbage collection and will cause the JVM to avoid lengthy old-gen garbage collection cycles.

Applying Aikar's flags is as simple as updating your Minecraft server's startup script to use the following Java flags:

java -Xms4096M -Xmx4096M -Dterminal.jline=false -Dterminal.ansi=true -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=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui

You will need to make a few simple modifications to the flags before you are ready to start your server. First, you will need to change the amount of RAM allocated to your server in the first two flags. In the example, we are allocating 4096MB of memory, but you may want to allocate more or less. We don't recommend allocating less than 2GB (2048MB) of memory to your server.

The second flag that you will need to modify is at the very end, where you will need to specify your server's jar file. In this example, we named the jar file server.jar, but you will need to update this to your server's jar file name, or rename your server's jar file to match server.jar.

You're able to choose from a few options when changing your startup script. If you can't see the option you need, please contact us and we'll apply your desired flags.

If you have any questions, please contact us for support.

Last updated