Documentation / Java startup options
Run your server
Minecraft server Java flags: Aikar's flags, ZGC and JVM options
Choose the garbage collector and add your own JVM flags on an Eytak Minecraft server. Which flags are accepted, why heap flags are refused, and how to reset.
Eytak runs Minecraft servers on Aikar's flags by default, a garbage collector tuning most Minecraft servers use, and it suits almost every server at any size. If you run a modpack whose authors publish their own Java flags, or want to try a different collector, you can change both from the panel.
This is an advanced setting. A flag that Java does not accept stops the server from starting, which is why each flag is checked while you type and again before it reaches the server.
Change the garbage collector or add flags
- Open your server and go to the Settings tab.
- Find the Java startup options card. It has its own save button, separate from the gameplay settings above it.
- Pick a collector from Garbage collector.
- Add any extra flags in Extra JVM flags, one per line.
- Click Save & apply. The server restarts to apply the change. Your world is kept.
The collector choices are:
- Aikar's flags (G1), the default. A sound choice at any size.
- ZGC. Very short pauses on servers with plenty of memory and several CPU cores. It uses more memory outside the heap than G1.
- Shenandoah. Another low-pause collector, worth trying if ZGC does not suit your server.
- JVM defaults. No tuning from Eytak. Meant for modpacks whose authors publish their own flags, which you add in the box below.
ZGC and Shenandoah need a newer Java than older Minecraft versions use. The Java version follows your Minecraft version, and a collector the server's Java is too old for is shown as needing a minimum Java version. If a server ends up on a version too old for the stored choice, for example after a reinstall onto an older Minecraft, it runs on Aikar's flags until it is on a newer one.
Which flags are accepted
Extra flags go one per line. These kinds are accepted:
-XX:options, such as-XX:MaxGCPauseMillis=130-Dsystem properties, such as-Dfile.encoding=UTF-8-Xssfor thread stack size- the module options
--add-opens,--add-exports,--add-modules,--enable-native-accessand--enable-preview
Flags may use only letters, digits and . _ - + = : , /, with no spaces or quotes. The card shows how many flags you have used and a maximum, and names any flag it refuses. Servers on Java 8 have no module options, so those flags are left off there and the card says which.
What is refused, and why
- Heap size. The heap is not yours to set. It follows your package's memory, so
-Xmx,-Xmsand similar flags are refused. A fixed heap above the container's real limit is how a server gets killed on boot. To get more memory, see pricing for packages. - Collector switches. Pick the collector from the list instead. Two collectors stop Java from starting.
- Agents and file-based options. Options that load agents or read more options from a file are not accepted.
- The watchdog switch. Flags that turn off the watchdog are refused, because auto-sleep depends on it.
If Java refuses a flag
If the server cannot start because of a startup option, the card shows Java refused these options, so the server can't start. The Console shows "Could not create the Java Virtual Machine", and the line just above it names the option. Fix the flag and save, or click Reset to defaults to go back to Aikar's flags with no extra flags. The server restarts either way. The console is where to read the error.
Troubleshooting
My flag is marked as refused. Read the message beside it. It says whether the reason is heap sizing, a collector switch, a setting Eytak controls, or characters that are not allowed.
The server will not start after I saved. Check the card for the red notice, look at the console line above the Java error, and reset to defaults if you cannot tell which flag it is.
I want to give the server more memory. You cannot set the heap in a flag. Memory comes from your package. See pricing.
Frequently asked questions
What are Aikar's flags?
A set of Java garbage collector options tuned for Minecraft servers. Eytak uses them by default.
Can I set -Xmx or -Xms?
No. The heap follows your package's memory, so flags that size the heap are refused.
Does changing Java flags restart my server?
Yes. Saving restarts the server to apply the change. Your world is kept.
Is ZGC or Shenandoah better than the default?
Not automatically. The default suits almost every server. ZGC is for servers with plenty of memory and several CPU cores, and both alternatives need a recent enough Java.
How do I undo a bad flag?
Click Reset to defaults on the Java startup options card. The server returns to Aikar's flags with no extra flags.