How much memory to give it
| Server | Memory |
|---|---|
| 1 to 5 players, vanilla or Paper | 2 to 3 GB |
| 5 to 15 players, a few plugins | 4 to 6 GB |
| Modpacks | 6 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.batnext to the jar and double-click it. - macOS and Linux: save it as
start.sh, runchmod +x start.shonce, 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.