The JVM Arguments field (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GKExpo/ServerPilot/llms.txt
Use this file to discover all available pages before exploring further.
jvmArgs) lets you pass extra flags to the Java Virtual Machine when ServerPilot launches your Minecraft server. These flags sit between the Java executable and the -jar option in the final command, giving you full control over garbage collection tuning, system properties, and other low-level JVM behaviour — without touching RAM allocation or JAR management, which ServerPilot handles separately.
The full launch command
ServerPilot constructs the launch command in the following order:| Segment | Source |
|---|---|
java | javaPath (server) → defaultJavaPath (global) → java |
-Xms2G | ramMin (server) → defaultRamMin (global) → 2G |
-Xmx4G | ramMax (server) → defaultRamMax (global) → 4G |
[jvmArgs...] | jvmArgs field — sanitized before insertion |
-jar paper.jar | Built from jarName; managed by ServerPilot |
nogui | Always appended by ServerPilot |
jvmArgs field is the only segment you control directly. Everything else is derived from the dedicated fields in Server Options and Global Settings.
Argument parsing
ServerPilot splitsjvmArgs on whitespace. Quoted strings with internal spaces are preserved as single arguments:
Automatic sanitization
Before inserting yourjvmArgs into the command, ServerPilot scans each token and removes any argument that conflicts with fields it already manages. A warning message listing all removed arguments is printed to the server console so you always know what was stripped.
The following are removed automatically:
| Stripped pattern | Reason |
|---|---|
java / java.exe | The executable is set via the Java Path field |
-jar <anything> | The JAR is set via the JAR Name field |
nogui / gui | Always appended (or omitted) by ServerPilot |
*.jar | Any bare JAR filename is managed by ServerPilot |
-Xms... | Set via the Min RAM field |
-Xmx... | Set via the Max RAM field |
Example of what gets stripped
If you enter the following intojvmArgs:
java, -Xmx8G, -jar paper.jar, and nogui, leaving only:
Recommended flags
Here is an overview of commonly used JVM flags and what they do:Enables the G1 (Garbage-First) garbage collector. G1 is the default collector in Java 9+ and is the standard recommendation for Paper and most Minecraft server software. It balances throughput and pause times well for heap sizes in the 2–16 GB range.
Enables parallel reference processing during GC cycles. This reduces the time the JVM spends processing weak, soft, and phantom references in parallel with the rest of the collection, which can meaningfully reduce overall GC pause duration on servers with many loaded chunks or entities.
Sets the target maximum GC pause time to 200 milliseconds. G1 uses this as a soft goal when scheduling collections — it will try to keep individual stop-the-world pauses under this threshold. Lower values reduce lag spikes but may increase GC frequency;
200 is a good balance for Minecraft servers.Enables the ZGC (Z Garbage Collector), which is designed for very low latency with pause times consistently under 1 ms regardless of heap size. Requires Java 17 or newer. Best suited for large-memory servers (8 GB+) where eliminating lag spikes is the top priority. Must be used together:
UnlockExperimentalVMOptions is required to enable UseZGC on some JDK builds.ZGC and G1GC are mutually exclusive — do not combine
-XX:+UseG1GC and -XX:+UseZGC in the same jvmArgs string.Common mistakes
Pasting a full launch command into jvmArgs A frequent mistake is copying a full launch command (e.g. from a server installation guide) and pasting the entire thing intojvmArgs:
java, -Xmx4G, -jar paper.jar, and nogui from that string, leaving jvmArgs effectively empty. Your server will launch using the RAM values from the dedicated Min RAM / Max RAM fields instead, which may differ from what you intended.
Correct approach: put only the extra flags in jvmArgs and set RAM via the dedicated fields: