BLACK FRIDAY UP TO -50% FULL YEAR
Glossary background texture

Aikar Flags

What are Aikar Flags in Minecraft? All You Need to Know.

Aikar Flags are a popular set of pre-tuned JVM (Java Virtual Machine) flags created by Aikar to improve Minecraft server performance and reduce garbage collection pauses. By optimizing how Java manages memory, these flags can significantly reduce lag spikes and create a smoother gameplay experience for your players all without touching your server's game settings.​


What Are Aikar Flags?

Aikar Flags are startup parameters that tell the Java Virtual Machine how to run your Minecraft server more efficiently. By default, Java's garbage collector isn't optimized for Minecraft servers, which can cause noticeable lag spikes when the JVM pauses to clean up memory.​

These flags were created by Aikar (a Paper developer) specifically to tune the G1 Garbage Collector (G1GC) for Minecraft's unique memory patterns. They control things like how often garbage collection runs, how long it's allowed to pause the server, and how memory is allocated across different generations.​


How Aikar Flags Work

Garbage collection is the process where Java cleans up unused memory to make room for new data. Without optimization, this can cause pause times which are brief moments where your server freezes while Java does cleanup, resulting in player lag.​

Aikar Flags optimize this process by:

  • Reducing pause times: Limiting how long the JVM can freeze the server during cleanup​
  • Preventing long collection cycles: Avoiding lengthy old-generation garbage collection that causes major lag spikes​
  • Improving memory allocation: Pre-touching memory pages at startup and configuring heap regions efficiently​
  • Enabling parallel processing: Allowing the JVM to handle multiple tasks simultaneously on multi-core systems​

The result is smoother gameplay with fewer noticeable lag spikes, especially during intensive operations like chunk generation or entity-heavy farms.


Key Flags Explained

Here's what some of the most important flags do:​

  • -XX:+UseG1GC: Enables the G1 garbage collector, which is better suited for Minecraft than the default collector​
  • -XX:MaxGCPauseMillis=200: Limits garbage collection pauses to 200 milliseconds maximum​
  • -XX:+DisableExplicitGC: Prevents poorly-coded plugins from forcing inefficient garbage collection​
  • -XX:+AlwaysPreTouch: Fully initializes all memory pages at startup to prevent memory-related errors during gameplay​
  • -XX:+ParallelRefProcEnabled: Enables parallel reference processing for better multi-core performance​

How to Enable Aikar Flags

Most modern hosting providers (including WiseHosting) apply Aikar Flags by default. If you need to apply them manually:​

  1. Access your server's startup settings in your control panel​
  2. Locate the JVM arguments or startup parameters section
  3. Replace the existing flags with Aikar's flags from the official documentation​
  4. Adjust the RAM values to match your server's allocated memory​
  5. Restart your server for the changes to take effect​

If your hosting provider doesn't allow manual flag editing, submit a support ticket to request Aikar Flags.​


Important Notes

  • Memory usage will show 100%: Aikar Flags allocate all available memory upfront, so monitoring tools may show full RAM usage. This is normal and intentional. Use plugins like Spark (/spark health) to see actual usage.​
  • Leave overhead for the JVM: On shared hosting, reserve about 1GB for Java overhead beyond your game server's needs.​
  • Test performance: While Aikar Flags work well for most servers, always monitor performance after applying them to ensure they're helping.​

Aikar Flags are the industry-standard JVM optimization for Minecraft servers, trusted by Paper and countless server administrators worldwide. They require zero gameplay changes but deliver noticeable performance improvements by making Java's memory management work better with Minecraft's unique needs.

Deal of the Year

BLACK FRIDAY
UP TO -50%

Host a Minecraft Server with the best price of the entire year

  • -50% First Month
  • -33% First Quarter
  • -50% First Year