Guides
Minecraft Server JVM Flags & Startup Arguments: What to Use in 2026
The right JVM flags can improve TPS and reduce lag. Learn which startup arguments to use for your Minecraft server—Aikar's flags, G1GC settings, and when to customize.

Minecraft server JVM flags (startup arguments) control how Java runs your server—especially how it uses RAM and runs the garbage collector (GC). The wrong flags can cause lag spikes and low TPS; the right ones can smooth out performance. This guide covers what to use in 2026: Aikar's flags, when to tweak them, and how they tie into healthy server performance.
Why JVM Flags Matter
Minecraft runs on Java. The JVM (Java Virtual Machine) decides how much memory to use, when to run garbage collection, and how to tune the GC for low latency. Default Java settings are generic—they're not tuned for a long-running game server that needs steady tick times. Poor GC settings cause lag spikes: the server freezes for 100–500ms while the GC runs, and TPS drops. Good startup arguments reduce GC pause times and help keep CPU and RAM working smoothly together.
Aikar's Flags (The Standard)
Aikar's flags are a set of JVM arguments designed for Minecraft servers. They enable the G1 garbage collector with settings that minimize pause times—critical for keeping TPS stable. Most hosts and server panels use a variant of these. For a typical server with 4–12 GB RAM allocated to the JVM, the following is a solid baseline:
-Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1
Replace 4G in -Xms4G -Xmx4G with your allocated RAM (e.g. -Xms8G -Xmx8G for 8 GB). -Xms and -Xmx should be equal so the JVM doesn't resize the heap at runtime, which can cause stutters.
Key Flags Explained
-Xms / -Xmx
Minimum and maximum heap size. Set both to the same value (e.g. 6G, 8G) so the JVM doesn't grow/shrink the heap during play—resizing can cause GC spikes.
-XX:+UseG1GC
Uses the G1 garbage collector. G1 is tuned for large heaps and aims for predictable pause times, which is what you want for a game server.
-XX:MaxGCPauseMillis=200
Tells G1 to try to keep GC pauses under 200ms. Lower values (e.g. 100) can reduce lag spikes but may increase GC frequency; 200 is a good balance for most servers.
-XX:+AlwaysPreTouch
Pre-allocates and touches memory at startup so the OS commits it early. Avoids surprise pauses when the heap grows during play.
How Much RAM to Allocate
Allocate to the JVM only what you want the game server to use—not the whole machine. If your plan has 8 GB RAM, give the server jar 6–7 GB and leave the rest for the OS and panel. Over-allocating (e.g. 12 GB on an 8 GB plan) can cause swapping and severe lag. For sizing by server type, see our modded server RAM guide and CPU vs RAM.
- Vanilla / light plugins: 2–4 GB
- Paper + plugins: 4–6 GB
- Light modded: 6–8 GB
- Medium/heavy modpacks: 8–12 GB+ (see ATM10, RLCraft)
When to Customize
Most servers are fine with Aikar's flags and the right -Xms/-Xmx. Consider tweaking only if you have evidence of GC-related lag (e.g. from /timings, Spark, or your host's metrics). You might try -XX:MaxGCPauseMillis=150 for slightly lower pause times, or adjust G1 region size on very large heaps (12 GB+). Don't change flags at random—measure before and after. For most admins, "set -Xms/-Xmx to your RAM and use Aikar's flags" is enough.
Host Panels and One-Click Setups
Many Minecraft server hosts pre-fill startup arguments in the panel. Check your panel's "Java settings" or "Startup flags"—if it already uses G1GC and sensible -Xms/-Xmx, you may not need to change anything. If the panel only has a "RAM" slider, it often sets -Xms/-Xmx for you but may use default GC; in that case, adding Aikar's flags (without duplicating -Xms/-Xmx) can help. If you're on a host that locks the command line, ask support what flags they use and whether you can customize them.
Java 17+: Minecraft 1.17+ requires Java 17 or newer. All modern JVMs support G1GC and the flags above. If you're on an older Java version, upgrade first—then apply the flags.
Summary
Minecraft server JVM flags matter for stable TPS and fewer lag spikes. Use Aikar's flags (or your host's equivalent), set -Xms and -Xmx to the same value matching your allocated RAM, and keep Java 17+. That covers the vast majority of servers. For more on why servers lag and how to interpret performance, see what a healthy Minecraft server feels like and why Minecraft servers lag.
Hosting with sensible defaults
BiomeHosting uses optimized JVM settings so your server runs smoothly. View plans and get started.