EndyStudio

Minecraft server RAM calculator

Enter your players and plugins to get a RAM estimate with the sum behind it, the matching -Xms and -Xmx, Aikar's flags, and a start script ready for Linux, Windows or Pterodactyl.

  • Free
  • No account
  • Runs in your browser

Your server

Software
Minecraft version

Estimate

Recommended
5 GB
Minimum
3 GB
Plan or container
6 GB
  • Heap (-Xms = -Xmx) 5 GB
  • Margin for Java 1 GB
  • Minimum

2 GB base + 20 players × 75 MB + 25 plugins × 40 MB = 4.5 GB, rounded up to 5 GB.

    Advanced

    Garbage collector

    The safe choice at any size. Aikar's flags are the ones Paper recommends.

    Optional, in GB. If you already have a server, enter it and the flags fit inside it.

    Start script

    Save it as start.sh next to the jar and start it with ./start.sh. The machine needs 6 GB free for this server, plus what the system uses.

    Java 25 · -Xmx5G

    How much RAM does a Minecraft server need?

    Most Paper servers do well with 3 to 8 GB of heap: 3 or 4 GB for a group of friends, 5 or 6 GB for 20 or 30 players with a normal set of plugins, and 8 GB or more past 50 players. The plan you rent has to be a bit bigger than that, because Java also uses memory outside the heap.

    Players online Plugins Minimum Recommended Plan or container
    5 10 2 GB 3 GB 4 GB
    10 15 3 GB 4 GB 5 GB
    20 25 3 GB 5 GB 6 GB
    30 40 4 GB 6 GB 7 GB
    50 50 5 GB 8 GB 10 GB
    100 80 8 GB 13 GB 15 GB

    The calculator above does the same sum with your numbers. Take the result as a starting point: real use depends on how spread out the players are, the view distance and what each plugin does.

    How the estimate is worked out

    The calculator adds up the heap, the memory Java gives Minecraft (the one you set with -Xmx):

    • 2 GB base for Paper or Purpur with its worlds loaded and nobody online. Folia starts at 3 GB, because it’s made for many players spread across the map.
    • 75 MB per player online at once. Each player keeps the chunks around them loaded, with the mobs and items in them. Players spread across the world cost more than players standing together in a lobby.
    • 40 MB per plugin, on average. Most plugins use far less, and a few use far more.
    • 2 GB more for heavy plugins or a big world: web maps (Dynmap, BlueMap), custom models (ItemsAdder, ModelEngine), lots of mobs or farms, or a view distance over 10.
    • Three quarters of the total on 1.8 to 1.11, whose chunks are lighter.

    The result is rounded up to whole GB and never goes below 3 GB (2 GB on 1.8 to 1.11). The minimum is about two thirds of it: the server runs, with little room for busy moments, new chunks being generated or backups. The calculator stops at 31 GB, because above about 32 GB Java turns off compressed object pointers, and going a little past that leaves less usable memory, not more.

    These numbers lean high on purpose. Running short of memory makes a server stutter and then crash, while a little too much only costs a bit more each month.

    Leave room for Java: heap and plan

    -Xmx only limits the heap. Java also uses memory for the classes of every plugin, its threads, the code it compiles, network buffers and the garbage collector’s own bookkeeping. The calculator keeps 1 GB or 15 % of the heap for that, whichever is more, in line with Paper’s advice to give -Xmx 1000 to 1500 MB less than the memory you have. In practice:

    • Renting a plan: go by the plan size the calculator shows, not the heap. An 8 GB heap needs a 10 GB plan.
    • Already have a plan: enter it in Your plan’s RAM and the flags are sized to fit inside it. An 8 GB plan leaves a 6.5 GB heap.
    • Pterodactyl, Docker and most hosts limit the whole container. If Java goes over, the server is killed on the spot, often with no error in the console.
    • Your own PC or VPS: leave memory for the operating system and anything else running there.

    Why -Xms equals -Xmx

    Aikar’s flags give -Xms and -Xmx the same value and add -XX:+AlwaysPreTouch, which reserves the whole heap when the server starts. G1 works better with a heap that never grows or shrinks, and if the memory isn’t really there, you find out at boot. One side effect: your panel’s memory graph shows the whole heap in use from the first minute. That’s expected.

    Aikar’s flags and ZGC

    Aikar’s flags tune the G1 garbage collector to the way Minecraft uses memory: huge numbers of objects that live for one tick, and pauses that have to stay short. Paper recommends them, and they suit servers of any size. Over 12 GB of heap the calculator switches to Aikar’s values for big heaps: G1NewSizePercent=40, G1MaxNewSizePercent=50, G1HeapRegionSize=16M, G1ReservePercent=15 and InitiatingHeapOccupancyPercent=20.

    ZGC is a different collector that does nearly all its work while the server keeps running, so pauses stay under a millisecond. In exchange it uses more CPU, and it only makes sense on large heaps (16 GB or more) with spare cores. Use the generational version: on Java 21 it needs -XX:+ZGenerational, and from Java 23 it’s the default, so the calculator leaves that flag out. If you’re not sure, stay with G1.

    Which Java version

    Minecraft Java
    26.1 and newer 25
    1.20 – 1.21.11 21
    1.17 – 1.19.4 17
    1.16.5 16
    1.12 – 1.16.4 11
    1.8 – 1.11 8

    This is the table in Paper’s documentation. Check which one you have with java -version. If several are installed, the script starts whichever one the java command runs.

    Starting the server

    1. Fill in players, plugins, software and version, plus your plan’s RAM if you already have one.
    2. Pick a Start script:
      • start.sh for Linux and macOS. Save it next to the jar, run chmod +x start.sh once, then ./start.sh.
      • start.bat for Windows. Save it next to the jar and double-click it. The pause at the end keeps the window open if the server stops, so you can read the error.
      • Pterodactyl gives the startup command, with {{SERVER_JARFILE}} so the panel fills in the jar. Then set the server’s memory in the panel to at least the plan size.
      • Flags only is for hosts with a field for JVM arguments. If your host sets the memory itself, remove -Xms and -Xmx.
    3. Press Copy. Copy share link keeps your settings in the link.

    When more RAM won’t help

    Lag usually comes from the CPU: a normal server does most of its work on one main thread, so a faster core helps more than extra memory. Before upgrading, run /spark health to see memory and TPS, and /spark profiler to see what takes the time. spark comes with Paper since 1.21. Lowering view-distance and simulation-distance saves memory and CPU at once, and pre-generating the world with a plugin such as Chunky avoids the spikes of generating new chunks while people play.

    Frequently asked questions

    How much RAM do I need for 10 or 20 players?

    On Paper with a normal set of plugins, about 4 GB of heap for 10 players and 15 plugins, and 5 GB for 20 players and 25 plugins. Java needs about 1 GB more on top, so look for a 5 GB or 6 GB plan. Heavy plugins such as web maps add about 2 GB.

    Does more RAM make my server faster?

    Only until it has enough. Past that point the extra RAM sits unused, and lag comes from the CPU, the plugins or the view distance. Check with /spark health and /spark profiler before paying for more.

    Why should -Xms and -Xmx be the same?

    Aikar's flags reserve the whole heap at start with AlwaysPreTouch, so Java never has to grow or shrink it while people play. And if the machine doesn't have that memory, you find out at boot, not on a busy evening.

    How much RAM should I leave outside the heap?

    At least 1 GB, or 15 % of the heap on big servers. Java also needs memory for plugin classes, threads, network buffers and the garbage collector. On Pterodactyl or Docker, if the whole process goes over the container's limit, the server is killed without warning.

    Should I use G1 or ZGC?

    G1 with Aikar's flags is the safe choice at any size, and it's what Paper recommends. Generational ZGC (Java 21 and newer) keeps pauses under a millisecond but uses more CPU and memory, so it's only worth trying on heaps of 16 GB or more with cores to spare.

    Which Java version does my server need?

    Minecraft 26.1 and newer need Java 25. Paper recommends Java 21 for 1.20 to 1.21.11, Java 17 for 1.17 to 1.19.4, Java 16 for 1.16.5, Java 11 for 1.12 to 1.16.4 and Java 8 for 1.8 to 1.11.