Minecraft JVM flags and start command generator
Prepare a start command with the memory allocation and collector you want to test. Begin with modern JVM defaults and add tuning only when measurements justify the change.
Leave memory for the OS and other processes. This value does not calculate how much RAM you need.
Start with your JVM’s default collector. Measure its behavior before adding tuning flags.
java -Xms4G -Xmx4G -jar server.jar --nogui
Check java -version and replace server.jar with your JAR filename. Selecting a version here does not change your Java installation.
Prepare your start command
- Run java -version in the environment that starts your server. Select that version here and check which runtime your Minecraft version requires.
- Allocate memory while leaving RAM for the OS. Choosing 8 GB produces Xms8G and Xmx8G; it does not mean your server needs 8 GB.
- Choose a preset. The GraalVM option is a basic command; you must install that distribution if you want to use it.
- Replace server.jar with your filename, run the command from its directory and check the console before putting it in a script.
Defaults, G1GC and ZGC
The G1GC preset is reduced and is not the full Aikar set. Compare pauses, memory and tick times under equivalent load; selecting a preset does not guarantee better TPS.
ZGC includes ZGenerational for Java 21 and omits it for Java 25, which uses generational mode by default. Java 17 uses ZGC without that mode. Whether your server supports a particular JVM is a separate check.
What flags cannot fix
CPU, chunks, plugins or mods can remain a bottleneck after changing the collector. This generator does not diagnose lag or predict player capacity. Use logs and measurements to identify the issue.
Put this into practice
Resource and community pages may contain content in the language chosen by their authors.
