kiphost

Minecraft server startup flags generator

If you run a server on your own computer or a VPS, how you start Java makes a real difference to lag spikes. Set the memory and jar name and copy a start script for Windows, macOS or Linux.

Loading the Startup flags generator…

How much memory to give it

ServerMemory
1 to 5 players, vanilla or Paper2 to 3 GB
5 to 15 players, a few plugins4 to 6 GB
Modpacks6 to 10 GB

Leave at least 1 to 2 GB for the operating system. Giving Java more than the machine has makes it swap to disk, which is far worse than too little memory. More than about 12 GB rarely helps a small server; garbage collection just takes longer.

The tool sets the minimum (-Xms) and maximum (-Xmx) to the same value. Java then grabs the memory once at startup instead of growing and shrinking, which avoids stutter.

What Aikar's flags do

Java frees unused memory with a garbage collector. Its defaults are tuned for programs that make big long-lived objects. Minecraft makes huge numbers of tiny short-lived ones every tick, and the default settings handle that with long pauses that show up as lag spikes.

Aikar's flags, written for Paper and recommended in its documentation, tune the G1 collector for that pattern: frequent short collections instead of rare long ones. Above 12 GB the tool switches to the variant Aikar published for large heaps.

Running the script

  • Windows: save it as start.bat next to the jar and double-click it.
  • macOS and Linux: save it as start.sh, run chmod +x start.sh once, then ./start.sh.
  • Paper 1.20.5 and later need Java 21. Check with java -version.

Kiphost servers already start with tuned flags, so you don't need this for a Kiphost server.

More tools

Need a server to try this on?

Kiphost servers are free. Log in with Discord and you'll have one in about a minute.

Get a free server