Optimization Guide
Best Minecraft
Server JVM Flags
The community-standard "Aikar flags" tune Java's garbage collector to smooth out lag spikes. Copy, set your RAM, done.
-Xms6G -Xmx6G -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:+UseStringDeduplication
Replace 6G with your plan's RAM (keep -Xms and -Xmx equal). Not sure how much? Calculate it →
Set -Xms and -Xmx equal
These set the minimum and maximum heap. Making them equal stops the JVM from resizing memory mid-game, which is a common cause of lag spikes. Match them to your plan's RAM.
Why G1GC + these flags
G1GC is the garbage collector best suited to Minecraft's memory pattern. The extra flags shorten and smooth GC pauses so you get steadier TPS instead of periodic freezes — especially on modded servers.
Most hosts set these for you
On a managed host, these flags are often applied automatically or via a one-click "optimized flags" toggle. If you self-host, paste them into your start script. See our reduce-lag guide for the rest.
Prices verified: July 2026 — always confirm current pricing on the host's site. MineHostFinder may earn a commission if you sign up through these links, at no extra cost to you. 💚