---
title: "Aikar flags: optimize the JVM on your Minecraft server | StreetHosting"
description: "Learn what Aikar Flags are: the JVM arguments that stabilize the garbage collector and cut lag spikes on Paper servers. How to set Xms, Xmx and G1GC correctly."
url: "https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft"
type: "page"
language: "en-US"
---

Minecraft · 3 min · Advanced

Published on Jun 17, 2026 · Updated on Aug 26, 2026

# Aikar flags for the Minecraft JVM

Periodic stutters are usually a badly tuned garbage collector. Aikar Flags configure G1GC to reclaim memory in small pauses, smoothing out TPS at peak hours.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Performance and optimization](https://streethosting.com.br/en/guides/topics/performance) [Paper, Spigot and proxies](https://streethosting.com.br/en/guides/topics/server-software)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=Aikar%20flags%3A%20optimize%20the%20JVM%20on%20your%20Minecraft%20server&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft "Share on LinkedIn") [](https://wa.me/?text=Aikar%20flags%3A%20optimize%20the%20JVM%20on%20your%20Minecraft%20server%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fminecraft%2Faikar-flags-minecraft "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft.md)

In this guide 5 sections

* [What Aikar Flags are](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#o-que-sao)
* [Xms equal to Xmx](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#xms-igual-xmx)
* [How to apply them](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#aplicar)
* [Measure the result](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#medir-resultado)
* [What the flags can't do](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#limites)

Quick answer

**Aikar Flags** are a set of JVM arguments that tune the `G1GC` garbage collector to reclaim memory in short pauses. Set `Xms` equal to `Xmx`, apply the flags on the launch line before the jar and measure TPS. The result is fewer periodic stutters at peak hours.

## What Aikar Flags are[](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#o-que-sao)

When the server freezes for half a second every now and then, the culprit is often the garbage collector clearing memory all at once. Aikar Flags reconfigure G1GC to do that cleanup in small, frequent chunks, spreading out the cost and avoiding the big pause that players feel as lag. They target a specific problem that [reducing lag on Paper](https://streethosting.com.br/en/guides/minecraft/reduce-lag-paper-server) also covers.

## Xms equal to Xmx[](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#xms-igual-xmx)

The most important point is to match the initial and maximum memory. If `Xms` and `Xmx` have different values, the JVM resizes the heap during gameplay and that causes pauses. With both equal, the memory is reserved all at once and the server behaves predictably.

Don't set the heap larger than the RAM you actually have available. Once the system starts using swap, TPS collapses and no flag will save it.

## How to apply them[](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#aplicar)

1. Stop the server.
2. Edit the launch line, setting `Xms` and `Xmx` to the same value.
3. Paste the set of Aikar Flags before the jar argument.
4. Save and start the server again.

On managed panels, there is a dedicated field for JVM flags. On a root VPS, they go in the systemd command or in the start script.

## Measure the result[](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#medir-resultado)

| Signal                | Before              | After the flags    |
| --------------------- | ------------------- | ------------------ |
| GC pauses             | Long and noticeable | Short and frequent |
| TPS at peak           | Fluctuating         | More stable        |
| Stutters every minute | Common              | Reduced            |

Use the spark plugin to visualize the pauses and TPS before and after. Without measuring, you can't tell whether the change helped. Make sense of the numbers in [what TPS is and how to improve it](https://streethosting.com.br/en/guides/minecraft/what-is-tps-minecraft).

Generate one spark profile before the flags and another after, and run both links through [tickdoc](https://tickdoc.streethosting.com.br/?utm%5Fsource=streethosting&utm%5Fmedium=site&utm%5Fcampaign=tools&utm%5Fcontent=guia%3Aconfigurar-aikar-flags-jvm-minecraft). It separates what was a GC pause from what is still a heavy plugin, which is the question left over after you tweak the JVM.

## What the flags can't do[](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#limites)

* Java at the version recommended for your Paper build
* Xms equal to Xmx, with headroom for the system
* Heavy plugins reviewed in parallel
* Measured with spark before and after

The flags fix memory pauses, but they won't work miracles. A weak CPU caps TPS no matter what. For demanding projects, a [Ryzen VPS](https://streethosting.com.br/en/vps/ryzen) with high per-core clock speed makes more difference than any tweak. To apply all of this on a root server, see [hosting Paper on a root VPS](https://streethosting.com.br/en/guides/vps/host-paper-minecraft-server-on-vps).

In this guide

* [What Aikar Flags are](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#o-que-sao)
* [Xms equal to Xmx](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#xms-igual-xmx)
* [How to apply them](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#aplicar)
* [Measure the result](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#medir-resultado)
* [What the flags can't do](https://streethosting.com.br/en/guides/minecraft/aikar-flags-minecraft#limites)

## Frequently asked questions

Why should Xms equal Xmx?

Matching the initial and maximum memory stops the JVM from resizing the heap during gameplay, which causes pauses. With both values equal, the allocation stays stable from boot.

Do Aikar Flags work for every server?

They work best on Paper and modern derivatives running a current Java version. On very old versions or different runtimes, some of the flags may not apply. Use the recommended Java version.

Should I give the server all of the machine's RAM?

No. Leave headroom for the operating system and the disk cache. Giving the heap too much memory can even make collection pauses worse instead of better.

Do the flags fix all lag?

No. They smooth out garbage collector pauses, but lag from a heavy plugin, a poorly optimized world or a weak CPU needs other fixes. Pair them with a timings review.

Next step

See Ryzen VPS

Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.

[See Ryzen VPS](https://streethosting.com.br/en/vps/ryzen)

[See Minecraft Pro Managed hosting on Ryzen with modpacks, optimized Paper and technical support.](https://streethosting.com.br/en/minecraft-pro) [Modpack hosting Forge and Fabric with RAM sized for heavy packs and fast activation.](https://streethosting.com.br/en/minecraft-modpack)

## Related guides

[Minecraft Intermediate Spark profiler: how to analyze Minecraft server lag A TPS of 20 and a stuttering server are not contradictory. Spark measures how much each tick really costs and shows, line by line, where that time is going. 7 min Read guide](https://streethosting.com.br/en/guides/minecraft/spark-profiler-minecraft) [Minecraft Intermediate How to reduce lag on a Minecraft Paper server (TPS and mspt) Lag is not 'the host's fault' until you measure it: high mspt comes from the world, the configuration and the code running in the tick. This guide puts diagnosis ahead of aggressive tuning. 6 min Read guide](https://streethosting.com.br/en/guides/minecraft/reduce-lag-paper-server) [Minecraft Intermediate What is TPS in Minecraft and how to improve it (complete guide) TPS is the server's clock: 20 means a smooth world, anything below that and everything lags behind. MSPT shows how many milliseconds each tick costs. Measuring before tuning tells a plugin problem apart from the wrong host. 6 min Read guide](https://streethosting.com.br/en/guides/minecraft/what-is-tps-minecraft)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
