Skip to main content
All tools

JVM tuning

Server Startup Flags Generator

Generate an optimized JVM start command and script for Paper, Purpur, Velocity, and Waterfall.

Software

Environment

Memory

4GB

Flags

The community standard for Paper servers. Balanced G1GC tuning that suits almost everyone.

Jar file name

Advanced options

Start script

start.sh
#!/usr/bin/env bash

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
Flags only

Just the JVM flags, for pasting into a host panel's startup field.

jvm flags
-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
Why these flags?
  • Xms is pinned to Xmx so the JVM grabs its full heap up front, avoiding mid-game resizes that cause lag spikes.
  • Aikar's Flags are the trusted default: G1GC tuned to keep garbage-collection pauses short and predictable.
  • At 12 GB or more, the G1GC presets switch to large-heap tuning (bigger regions, earlier collection) so big servers stay smooth.
  • Most servers should pick Aikar's Flags and a sensible RAM size first. The other presets are for owners who benchmark their own hardware.

These flags are a starting point, not a substitute for right-sizing RAM. Verify against each author's current reference before relying on them in production.