Official startup and profiling tools
A startup script sets the Java command and memory options used to run Paper. PaperMC documents an optional set of Aikar’s G1GC flags; compare settings and test them for your workload 1 2. Use spark to investigate server performance when a problem occurs 4 5.
Required server and profiler downloads
Size heap memory below host limits
The Java heap is only part of a server’s memory use. Leave room for the operating system, native JVM allocations, plugins and other processes, and monitor actual usage under load. PaperMC’s Aikar guide offers examples; the right heap size depends on your world, players and host 1.
Illustrative heap allocations; measure host and JVM usage before choosing
| VPS total RAM | Example heap | OS headroom left | Note |
|---|---|---|---|
| 4 GB | 2500M to 3G | 1 GB+ | Example only; workload and native memory vary |
| 8 GB | 6G | 2 GB | Example only; workload and native memory vary |
| 12 GB | 10G | 2 GB | Example only; workload and native memory vary |
| 16 GB | 12G to 14G | 2 GB to 4 GB | Example only; workload and native memory vary |
Linux start.sh script with Aikar flags
The example uses Aikar’s G1GC flags documented by PaperMC. Their effect depends on the JVM and workload; compare the current official guide for your heap size and test before using them on a live server 1.

#!/usr/bin/env bash
java -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: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 \
-jar paper.jar --noguiWindows start.bat script and file naming
On Windows, place start.bat in the server directory and make sure the -jar argument matches the downloaded file. Quote paths containing spaces. The example uses optional G1GC flags; check your Java version, heap and current Paper guidance before applying them 1 2.
@echo off
java -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 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar --nogui
pauseRunning inside tmux or systemd on Linux
An ordinary SSH session may end its child processes when it disconnects. A tmux session or a properly configured service manager can keep the server running independently. Detach with Ctrl+B, then D, and reattach with tmux attach -t mc-smp. Stop Paper cleanly using its console stop command before maintenance. Avoid force-killing it during writes.
chmod +x start.sh
tmux new-session -d -s mc-smp './start.sh'
tmux attach -t mc-smpVerify startup health with spark before adding plugins
Paper 1.21 and later includes spark. Use it to establish a baseline and capture a profile while an issue is happening 4 5. For initial boot checks, see the Java SMP setup guide.
Startup and flag verification steps
- Check Paper’s recommended Java version for the exact server release and verify it with
java -version2. - Leave memory for the operating system, native JVM usage and other processes; monitor actual usage 1.
- Check
-jar paper.jarmatches the exact JAR name in your server directory 2. - Wrap Linux launches in
tmuxorsystemdand stop viastop, neverkill -9. - Confirm
/spark healthshows low GC pause overhead on a clean idle server 5.
Frequently asked questions
Should -Xms always equal -Xmx on a Minecraft Paper server?
Equal initial and maximum heaps are an option in Aikar’s example, but they are not mandatory for every server. Choose settings appropriate to the host and measure the result.
What should I do if a managed game host locks Java startup flags?
Check your host’s startup settings or ask its support which flags are already supplied. Avoid adding duplicate heap arguments.
Do modern Java 21 or Java 25 builds use ZGC instead of Aikar's G1GC flags?
Paper documents an optional G1GC configuration. Collector choice depends on the Java version and workload; benchmark changes before applying them to production.
Why does start.bat end with pause on Windows?
Adding pause keeps the console window open if Java fails to find paper.jar or hits a version mismatch, making error messages readable.
Next step in the Paper baseline
Sources & evidence
- Aikar's Flags (PaperMC)
- Getting started (PaperMC)
- Paper downloads (PaperMC)
- spark on Modrinth (Modrinth)
- spark documentation (spark)


