Minecraft Server GC Lag: What It Is and How to Fix It

A glowing Nether portal standing in a grassy Minecraft field

GC lag has a distinctive symptom that sets it apart from most other Minecraft performance issues: instead of a steady, constant slowdown, the server runs fine and then freezes briefly and repeatedly, at intervals, before recovering. That pattern points specifically at Java's garbage collector.

Why garbage collection causes freezes

Java automatically manages memory, and periodically has to pause the application (or parts of it) to identify and reclaim memory no longer in use. With the default, untuned JVM settings, these pauses can be long and disruptive enough for players to notice as a stutter or brief freeze, particularly on servers with larger heaps.

Confirming GC is the cause

Spark's GC monitoring correlates garbage collection events directly with tick time spikes, if a freeze lines up with a logged GC pause, that confirms the cause rather than leaving it as a guess.

The fix: Aikar's flags

Aikar's flags are a specific, well-tested set of JVM startup flags that tune the G1 garbage collector for Minecraft's particular memory allocation pattern, significantly reducing pause frequency and duration compared to default settings. They are widely considered close to a required baseline for any Paper or Spigot server rather than an optional tweak.

A few important details when applying them:

  • Reserve some RAM above your -Xmx value for the OS and JVM overhead itself, do not allocate 100% of available memory to Xmx.
  • Set -Xms equal to -Xmx to avoid additional resizing overhead on top of GC tuning.
  • As of mid-2026, newly created Paper servers get reasonably tuned JVM flags automatically based on detected Java version, though applying Aikar's flags explicitly still gives more control.

Beyond Aikar's flags: alternative collectors

For very large heaps or servers still seeing pause issues after applying Aikar's flags, some admins move to ZGC, a low-pause-time collector built for exactly this kind of workload, though it comes with its own tradeoffs and is a more advanced change than the default G1GC tuning most servers need.

Right-sizing RAM alongside GC tuning

An oversized heap gives the garbage collector more memory to scan per pause, worsening GC lag even with good flags applied. See our RAM sizing guide to make sure your allocation itself is not part of the problem.

Applying this without the manual setup

Tick Hosting's panel applies tuned JVM flags automatically on every server, including the free tier, so GC lag is handled from the start rather than something you need to configure by hand. Get started on Tick Hosting's plans page.