Skip to content
uxTools
Gaming

Minecraft Server Flag Generator

Generate optimized JVM startup flags for your Minecraft server. Pick a battle-tested preset — Aikar's, MeowIce, Benchmarked G1/ZGC/Shenandoah, Hilltty, Obydux, Etil — and ship a ready-to-run start.sh, .bat, .command, Dockerfile, systemd unit or Pterodactyl egg.

10
server types
9
flag presets
3
extras
8
output formats
Server softwarePick the engine running your server
Flag presetCurated, sourced flag bundles
Extra flag groups

Heap memory

4 GB
How much RAM should I allocate?
  • <10 players2-4 GB
  • 10-30 players4-8 GB
  • 30-60 players8-12 GB
  • 60-100 players12-16 GB
  • 100+ players16-32 GB
Java version
Advanced options

Headless (--nogui)

Run without the Swing GUI. Auto-disabled for proxies.

Show full stack traces

Adds -XX:-OmitStackTraceInFastThrow so repeated exceptions still print stacks.

Auto-restart loop

Wraps the script in a while/goto loop so the server restarts after a crash.

Use script variables

Emits fileName= and memory= variables at the top of the script for easy editing.

Calculate JVM overhead

Reduces -Xmx below the requested allocation to leave room for off-heap memory.

Large pages (HugeTLB)

Enables -XX:+UseLargePages. Requires kernel + Java support.

Generated start command

23 flags · Aikar / PaperMC

Download jar
start.sh
1#!/usr/bin/env bash
2set -euo pipefail
3
4java -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 -XX:-OmitStackTraceInFastThrow -jar paper.jar nogui
5
Flag breakdown

Memory

  • -Xms4096M
    Initial heap size. Set equal to Xmx so the JVM doesn't grow on demand.
  • -Xmx4096M
    Maximum heap size. Hard cap on the Java heap.

Preset flags

  • -XX:+UseG1GC
    Garbage-First collector. Best general-purpose GC for Paper-family servers.
  • -XX:+ParallelRefProcEnabled
    Parallelises reference processing during GC pauses.
  • -XX:MaxGCPauseMillis=200
    Soft target for GC pause time. G1 will trade throughput to stay under it.
  • -XX:+UnlockExperimentalVMOptions
    Allows experimental tuning flags.
  • -XX:+DisableExplicitGC
    Ignores System.gc() calls from plugins/mods.
  • -XX:+AlwaysPreTouch
    Touches every heap page on startup. Slower boot, smoother runtime.
  • -XX:G1HeapWastePercent=5
    Waste threshold before mixed GCs are triggered.
  • -XX:G1MixedGCCountTarget=4
    Number of mixed GC cycles to drain old-generation garbage.
  • -XX:InitiatingHeapOccupancyPercent=15
    Heap occupancy that triggers a concurrent GC cycle.
  • -XX:G1MixedGCLiveThresholdPercent=90
    Live data threshold above which a region is skipped during mixed GC.
  • -XX:G1RSetUpdatingPauseTimePercent=5
    Maximum pause time spent updating remembered sets.
  • -XX:SurvivorRatio=32
    Eden:Survivor space ratio. 32 keeps short-lived objects from promoting too fast.
  • -XX:+PerfDisableSharedMem
    Disables /tmp/hsperfdata files; avoids stalls on slow disks.
  • -XX:MaxTenuringThreshold=1
    Promote survivor objects to old gen after N collections.
  • -Dusing.aikars.flags=https://mcflags.emc.gs
    Marker constant Aikar's flags look for at startup.
  • -Daikars.new.flags=true
    Enables Paper's tuned defaults that match these flags.
  • -XX:G1NewSizePercent=30
    Minimum young generation as % of heap. Higher = better throughput, more pauses.
  • -XX:G1MaxNewSizePercent=40
    Maximum young generation as % of heap.
  • -XX:G1HeapRegionSize=8M
    G1 region granularity. 8M for ≤12 GB heaps, 16M above.
  • -XX:G1ReservePercent=20
    Heap percentage kept as a reserve for evacuation failures.

System / debug

  • -XX:-OmitStackTraceInFastThrow
    Forces full stack traces, even for repeated exceptions.

Presets sourced from PaperMC docs, Aikar, MeowIce, brucethemoose's benchmarks, Hilltty, Obydux and Etil. Settings persist locally.