Minecraft JVM Flags Generator
Generate optimized Minecraft server launch scripts with Aikar's Flags, Velocity/Waterfall proxy flags, or no-flag baseline. Export as start.sh (Linux), start.bat (Windows), or raw Java command. Auto-restart loop, Pterodactyl support, Java 17+ SIMD vectors.
Memory Allocation
Sets both -Xms (initial) and -Xmx (maximum) to the same value. Unequal values cause GC pause spikes.
Flag Preset
Environment
Options
Flag presets ported from flags.sh (MIT license). Aikar's flags from mcflags.emc.gs.
start.sh
#!/bin/bash
while [ true ]; do
java -Xms4096M -Xmx4096M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui
echo Server restarting...
echo Press CTRL + C to stop.
doneHow to use
- Save as
start.shin your server folder - Make it executable:
chmod +x start.sh - Run:
./start.sh
Minecraft Server Flags Generator
Minecraft's default JVM flags aren't tuned for a real server. Without optimization, the garbage collector pauses the server for 200+ms at a time, causing visible tick lag to players. Aikar's Flags — the de-facto standard for Minecraft server optimization — tune the G1 garbage collector specifically for Minecraft's allocation patterns, eliminating these pauses.
Pick your memory size (0.5–32 GB) and flag preset. Aikar's is recommended for any backend server (Paper, Spigot, Purpur, Forge, Fabric, NeoForge, Vanilla). Velocity / Waterfall presets are tuned for proxy software — different allocation pattern, different flags. 'None' gives you the base Java command if you want to add your own.
Export as a Linux shell script (start.sh), Windows batch file (start.bat), or raw Java command for hosting panels. Optional auto-restart wraps the command in a loop that restarts the server if it crashes. Pterodactyl mode adds terminal rendering flags for that specific panel. Java 17+ modern vectors enable the incubating SIMD module used by Minecraft 1.19+.
Flag presets are ported from the open-source flags.sh project (MIT license). Output matches flags.sh exactly so you can trust the values. If you're running a hosted server, paste the command into your panel's Startup tab. If self-hosted, save the script next to your server.jar and run it.
Minecraft JVM Flags Generator — FAQ
What are Aikar's flags?
Aikar's flags are a set of JVM startup arguments that tune the G1 garbage collector specifically for Minecraft servers. They minimize GC pauses by pre-allocating memory, triggering concurrent marking early, and tuning survivor ratios. Aikar (a PaperMC lead dev) published them years ago and they're now the default on virtually every competitive Minecraft host.
Why use Aikar's flags instead of default JVM flags?
Default JVM flags are tuned for short-lived desktop apps, not long-running game servers. Without Aikar's flags, Minecraft servers regularly pause for 200–500ms during major GC cycles, which players see as stutters and lag. With them, GC pauses drop to 50ms or below.
Do I need different flags for more RAM?
Yes — Aikar's flags have two variants. For heaps under 12GB use the 'standard' region config (G1HeapRegionSize=8M). For 12GB and above, use the 'large' config (G1HeapRegionSize=16M, higher G1NewSizePercent). Our generator picks the right variant automatically based on your memory setting.
What's Velocity / Waterfall and why different flags?
Velocity and Waterfall are proxy servers that route players between backend Minecraft servers. Proxies don't run the game world — they just shuffle packets. Their allocation pattern is completely different, so they use simpler flags with smaller G1HeapRegionSize and fewer tuning knobs.
What does auto-restart do?
Auto-restart wraps your launch command in a while loop (Linux) or goto loop (Windows). If the server crashes or is stopped with /stop, the loop restarts it immediately. Convenient for production servers — but add a 2-second sleep if you see rapid restart loops.
What's Pterodactyl mode?
Pterodactyl is a popular open-source hosting panel. Its console UI needs two extra flags (-Dterminal.jline=false -Dterminal.ansi=true) to render output correctly. Enable this if you're deploying to a Pterodactyl server.
Should I enable Modern Vectors?
Only on Java 17+ running Minecraft 1.19 or newer. Modern vectors enable the JDK's incubating SIMD module which Minecraft uses for certain world-gen calculations. Slight performance boost on modern CPUs. Safe to leave off if unsure.
You might also need
XP Calculator
Calculate experience points needed between levels
Enchantment Calculator
Find the best enchantment combinations for your gear
Server Status Checker
Check if any Minecraft server is online and view player count
Server Properties Generator
Generate a complete server.properties file with all options

Config Tool Built Into XGamingServer
Get managed Minecraft hosting with this tool in your panel — configure, deploy, and play in minutes. No file uploads needed.