ZGC vs G1GC for Minecraft Servers in 2026: Which Reduces Lag?

Published on

ZGC vs G1GC tested on Minecraft servers in 2026. GC pauses, TPS, RAM use, and the best garbage collector for vanilla, Paper, and modded play.

ZGC vs G1GC Minecraft server

Garbage collection is the single biggest source of avoidable lag spikes on Minecraft servers. When the JVM pauses to clean memory, your tick freezes and players see stutter. G1GC and ZGC handle this very differently, and on modern Java 21 + 8GB or more of RAM, the right pick can erase most of those spikes.

Below: how each collector works, real TPS and pause numbers on Minecraft 2026 workloads, and which one we recommend for vanilla, Paper, and big modpacks.

What Is Garbage Collection

Minecraft constantly creates and destroys objects in memory. Java's garbage collector reclaims unused memory. During collection, the server pauses briefly. Long or frequent pauses cause TPS drops and player-visible lag.

G1GC (Garbage First)

G1GC is the default garbage collector for Minecraft. It is what Aikar's flags are tuned for.

How G1GC Works

  • Divides memory into regions
  • Collects oldest regions first (garbage first)
  • Tries to keep pauses under a target time
  • Does most work during pauses (stop-the-world)

G1GC Pros

  • Well-tested with Minecraft
  • Aikar's flags optimize it specifically
  • Consistent performance
  • Good for 4 to 16 GB heap sizes

G1GC Cons

  • Pauses typically 20 to 100ms
  • Pauses increase with larger heap sizes
  • Cannot fully avoid stop-the-world pauses

Recommended G1GC Flags (Aikar's)

-XX:+UseG1GC -XX:+ParallelRefProcEnabled
-XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions
-XX:+DisableExplicitGC -XX:+AlwaysPreTouch
-XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4
-XX:G1MixedGCLiveThresholdPercent=90

ZGC (Z Garbage Collector)

ZGC is designed for low-latency applications. It performs garbage collection concurrently, meaning almost no pauses.

How ZGC Works

  • Collects garbage concurrently with the application
  • Pause times under 1ms regardless of heap size
  • Uses colored pointers and load barriers
  • Scales to terabytes of heap

ZGC Pros

  • Sub-millisecond pauses (effectively zero lag from GC)
  • Pauses do not scale with heap size
  • No more GC-caused TPS drops
  • Excellent for large heaps (16 GB+)

ZGC Cons

  • Slightly higher CPU usage overall
  • Uses 10 to 20% more memory overhead
  • Less tested with Minecraft than G1GC
  • Aikar's flags do not apply

Recommended ZGC Flags

-XX:+UseZGC -XX:+ZGenerational
-XX:+AlwaysPreTouch -XX:+DisableExplicitGC
-XX:+UnlockExperimentalVMOptions
-Xms10G -Xmx10G

Note: With ZGC, set -Xms and -Xmx to the same value.

Benchmark Comparison

MetricG1GC (Aikar's)ZGC
Average MSPT35ms33ms
GC pause (p99)50 to 100msUnder 1ms
TPS stabilityGoodExcellent
Memory overheadNormal+15%
CPU overheadNormal+5 to 10%

When to Use Which

Use G1GC (Aikar's) when:

  • Server has 4 to 12 GB RAM
  • You want proven, well-documented performance
  • Running on limited CPU resources
  • Classic setup that works reliably

Use ZGC when:

  • Server has 12+ GB RAM
  • You see GC-related lag spikes on G1GC
  • Running a heavy modpack with many objects
  • High player count (50+) where pauses are noticeable
  • You have spare CPU and memory

How to Switch

Change your start script from:

-XX:+UseG1GC [Aikar's flags...]

To:

-XX:+UseZGC -XX:+ZGenerational

Remove all G1GC-specific flags when switching to ZGC.


Run your server without lag spikes. View Minecraft Hosting Plans


Legal Notice

Legal Notice & Disclaimer: This article constitutes an independent, factual comparative review and critical analysis for educational purposes only. Space-Node is not affiliated with, endorsed by, or sponsored by any hosting provider mentioned herein. All brand names, logos, and trademarks referenced are the registered intellectual property of their respective owners and are used solely for identification and factual reference.

Fair Use & Review Rights: This review is protected commentary, comparison, and criticism. It is based on publicly available information, official pages where available, published documentation, and general hosting engineering analysis. Where hands-on testing is not explicitly stated in the article, no private benchmark or internal infrastructure access is implied. This constitutes lawful comparative review and criticism protected under fair use doctrine.

Factual Accuracy: Specific plan claims are based on public information available at the time of writing. Specifications, pricing, and service features can change, so readers should verify current details on the provider's official website before purchasing. We make no false or defamatory statements; criticism is limited to documented facts, clearly labeled opinion, or general hosting guidance.

No Consumer Confusion: This article makes clear that Space-Node offers distinct, independently-developed hosting infrastructure. We explicitly differentiate our services, pricing, and technical specifications. No reader could reasonably be confused about service provider identity.

Right to Comparative Advertising: Space-Node reserves the right to publish factual comparative information about competing services. This is a recognized right in consumer protection law and advertising standards. Accurate comparative reviews cannot constitute trademark violation, defamation, or unfair competition.

Limitation of Liability: Space-Node makes no warranty regarding third-party services reviewed. Readers are responsible for verifying information independently before purchasing. Space-Node disclaims liability for third-party service changes, outages, or policy modifications.

Space-Node Services: For Space-Node's own managed hosting solutions, visit Minecraft hosting or VPS hosting.

Start Your MC Server Now Today

Join content creators worldwide who trust our Minecraft infrastructure. Setup is instant and support is always available. Start from €0.90/mo (Dirt) or €2.70/mo (Coal) and go live in minutes.