GuavaHost
Language & currency
Client AreaGame Panel Toggle navigation
Games All Games
Minecraft JavaMinecraft BedrockMinecraft GeyserRustRuneScape: DragonwildsPalworldValheimValheim + BepInExARK: Survival EvolvedARK: Survival AscendedProject ZomboidEnshroudedDon't Starve TogetherCounter-Strike 2TerrariatModLoaderHytaleMulti-Game ServerDiscord Bot Hosting
Navigation PricingReviewsHelp CenterSupport Company About UsFAQRefer to earnSLATerms of ServicePrivacy Policy
Language & currency
Client AreaGame Panel

JVM flags for Minecraft: what Aikar's flags do

Java garbage collection pauses show up in game as a stutter everyone feels at once. Here is what the well known flag set changes, where your server's startup command lives, and when changing flags genuinely helps.

6 min read · Updated Oct 21, 2026 · By GuavaHost Team

What a garbage collection pause feels like

Minecraft Java runs on the Java Virtual Machine, and Java manages memory for you. Every object the server creates sits in a pool called the heap, and a background process called the garbage collector periodically works out what is no longer needed and frees it.

Most of that work happens alongside the game. Some does not: the collector sometimes has to stop every thread in the process to finish a step. That is a stop the world pause, and while it lasts the server does nothing at all.

In game, a long pause looks like this: everyone freezes at once rather than one player, mobs stop, water stops flowing, then everything snaps forward and catches up. It happens on a rough rhythm, every minute or few minutes, rather than randomly, and your MSPT graph shows sharp spikes with healthy values in between.

That last point is how you tell a GC pause from ordinary lag. Plugin lag and entity lag raise your average tick time, while GC pauses leave the average fine and punch occasional holes in it. Reading TPS and MSPT explains both numbers, and finding lag with spark shows GC activity in its report so you can confirm it rather than guess.

What the flag set actually changes

Aikar's flags are a set of JVM options that a well known Paper developer published years ago, and they became the standard for Minecraft servers. They do not add memory and do not make the game faster. They change how the garbage collector behaves, trading a little raw throughput for far fewer long pauses.

The changes, in plain terms:

  • Use G1, and tune it for Minecraft's allocation pattern. G1 splits the heap into regions and collects a few at a time. Minecraft allocates a huge number of short lived objects, so the flags make the young generation (where new objects land) much larger than the default, and more garbage is thrown away cheaply before it is ever promoted.
  • Collect earlier and more often. The flags lower the point at which G1 starts a collection cycle, so it begins tidying well before the heap is nearly full. Starting late is what causes a long emergency collection.
  • Aim for a pause target, which tells G1 to do less work per stop: more frequent but much shorter stops. Short and often is what a game wants.
  • Bigger heap regions, which suit Minecraft's many medium sized objects and reduce bookkeeping.
  • Touch all the memory at startup, so the heap is claimed from the operating system up front and you do not get a pause later just because the process is growing.
  • Ignore explicit collection requests. Some plugins politely ask Java to run a full collection, which is almost always a bad idea in a game loop, and the flags make the JVM ignore it.
  • Fixed heap size. Minimum and maximum heap are the same value, so Java never resizes the heap while the server runs.

The set is tuned differently for small and large heaps, because a sensible young generation and region size depend on how much heap there is. That matters in the warning below.

Where your server's startup command lives

On GuavaHost, your Minecraft server already starts with a tuned flag set, so you do not have to assemble one yourself and in most cases should not.

To see exactly what your server starts with:

  1. Sign in at customer.guavahost.com, open My servers and click Manage.
  2. Open the Settings tab and find Startup settings.
  3. Open Show the full startup command. That is the real command line, flags, heap size and all.

Startup settings is also where the fields your server type exposes live, including Custom Parameters where one applies: startup parameters in the panel covers the page.

If you have read the warning below and still want the flags changed, ask us in Discord rather than pasting a flag set that fights your plan size.

When flags help, and when they do nothing

They help when you have a reasonably large heap and a busy server and your MSPT graph shows periodic spikes rather than a high baseline, when you are running lots of entities or chunk loading or a big modpack, or when you previously ran with nothing but -Xmx, which is where the default collector settings genuinely do cause long pauses.

They do nothing when:

To tell which camp you are in, look at MSPT over a few minutes. Flat and high means work, so tune the game. Low with periodic spikes means pauses, so the collector is worth looking at.

The warning: do not copy someone else's flags

This is the part that causes real damage, and it comes up constantly.

A flag set is tied to a Java version. Options get deprecated and then removed between Java releases. Paste a flag list written for Java 8 into a modern Java and the server may refuse to start at all, with an unrecognised option error in the Console. Which Java your Minecraft version needs is in choosing a Java version.

A flag set is tied to a heap size. Several values in a tuned set are chosen for the amount of heap you have, so the large heap variant on a small plan is actively worse than leaving it alone.

The heap must be smaller than the plan. Java needs memory outside the heap for thread stacks, class metadata, direct buffers and its own overhead. Setting the maximum heap to your entire plan size means the process gets killed when it reaches for that extra memory, which looks like a crash with no error: the signs a server is running out of RAM covers it.

Alternative collectors are not drop in. ZGC and Shenandoah have their own tuning and their own trade offs, and a set of G1 flags with one ZGC flag pasted in the middle is simply broken.

Measure before and after, or do not bother. If you cannot say what your MSPT looked like before the change, you cannot say whether it helped.

Common questions

Do I need to add Aikar's flags to my GuavaHost server myself?

No. Your server already starts with a tuned flag set, and you can read the exact command under Startup settings on the Settings tab. If you have a specific reason to change it, ask the team rather than pasting a flag list, because the right values depend on your Java version and your plan's memory.

Will JVM flags fix my low TPS?

Only if your low TPS comes from garbage collection pauses, which look like periodic freezes everyone feels at once with healthy tick times in between. A consistently high MSPT means the server is genuinely busy, and that is a plugin, entity, view distance or CPU problem instead.

Should I set the maximum heap to all of my server's RAM?

No. Java needs a slice of memory outside the heap for itself, so the maximum heap has to sit below the plan total or the process gets killed for using more than it is allowed. That is one of the reasons the startup command is managed for you.

Still stuck? Jump into our Discord at discord.gg/GuavaHost and the team will help you out.

  • jvm
  • java
  • performance
  • minecraft
  • garbage-collection

Host a Minecraft Java server From $3.99/mo, with instant setup and DDoS protection.

Still need help? Our team is online 24/7 to answer questions.

Contact support

Related guides

More from Minecraft: Java.