Skip to main content
Early Access: MineXHost is live and still being built. Expect maintenance and occasional outages. Check live status

How much RAM does a modpack need? Our server RAM calculator's estimate, explained, and how to set -Xmx and -Xms

Updated 10 min read By MineXHost

A modded server is sized by two things: how big the pack is and how many players are online at the same time. This page gives estimated starting points for both, explains why the memory on a plan is not all available to the game, and shows how to tell a memory problem from a CPU problem before you pay for more.

Estimated starting points

The figures below are our own estimate model, the one our RAM calculator uses. They are estimates for smooth play on a typical pack of each size, not measurements of any particular modpack, and two packs with the same mod count can differ a lot. Start from the row that matches your pack, add the per-player estimate for each person online at once, and round up.

What you runTypical sizeEstimated baseEstimated add per player online
VanillaNo mods2 GB0.05 GB
Vanilla with pluginsPaper or Spigot, up to about 25 plugins3 GB0.08 GB
Light modpackAbout 50 to 100 mods4 GB0.10 GB
Medium modpack100 to 200 mods6 GB0.15 GB
Heavy modpack200 to 400 or more mods8 GB0.20 GB
Expert-tier packThe biggest and heaviest packs10 GB0.25 GB

Worked example of the estimate: a medium pack with 5 players online is 6 + 5 × 0.15 = 6.75 GB, which rounds up to an estimated 7 GB. The same pack with 20 players online is 6 + 20 × 0.15, an estimated 9 GB.

Tip

Player count means players online at the same time, not everyone who has ever joined. A server with 40 members who are never on together sizes like a server for the number who actually play at once.

The calculator runs this same estimate for your pack size and player count, and matches the result to a plan.

Open the RAM calculator

What actually uses the memory

Most of what a server holds in memory is the loaded world and what lives in it. A modpack adds to that in two ways: every mod's code has to be loaded, and many mods add blocks, machines and creatures that keep their own state in the loaded chunks.

  • Loaded chunks. Each player keeps an area of chunks loaded around them, set by view-distance in server.properties. The area grows with the square of the distance, so dropping from 12 to 8 roughly halves the chunks in memory.
  • Players spread out. Players standing together share one loaded area; players exploring in different directions each load their own. That is why the per-player figure is an average, and a server of explorers needs more than a server of builders.
  • Entities and block entities. Mobs, item drops and modded machines, pipes and storage keep state while their chunk is loaded. Large automated bases are a common reason one server needs more than another running the same pack.
  • Mod code. Every mod's classes are loaded into memory outside the main heap, so a 300-mod pack uses memory before a single chunk loads.
  • World generation. Generating new terrain is heavier than loading terrain that already exists, so a new world with players exploring uses more than the same world a month later.

The RAM on your plan is not all Java heap

Java splits its memory. The heap, capped by -Xmx, holds the world and everything the game creates. Outside the heap Java also needs room for loaded classes, compiled code, network and file buffers, thread stacks and the garbage collector's own bookkeeping. All of it has to fit inside the server's memory limit together.

That is why a server should never get an -Xmx equal to its full RAM. A heap that fills the whole box leaves nothing for the rest, and the operating system ends the process without a Java error when the total crosses the limit: the exit code 137 kill. A heap a little smaller than the RAM is the correct setting, not a waste.

Running out of memory prints a different error depending on which pool filled up, and the fix differs for each.

Read the OutOfMemoryError guide

Setting -Xmx and -Xms

On a server you run yourself, the estimate becomes two Java options. -Xmx sets the largest the heap may grow. -Xms sets the size the heap starts at, which is also its minimum. Both take a number with a unit letter, k, m or g in either case, so -Xmx6G and -Xmx6144M mean the same thing.

OptionWhat it setsExample
-XmxThe maximum heap size-Xmx6G
-XmsThe starting and minimum heap size-Xms2G
  • Put them before -jar: java -Xms2G -Xmx6G -jar server.jar. Anything after the jar's file name goes to Minecraft, not to Java.
  • NeoForge's installer writes a user_jvm_args.txt file for these options; its run.sh and run.bat scripts read it.
  • Set -Xmx below the machine's or container's total memory, never equal to it, so Java has room for everything outside the heap.
  • Java's own reference notes that servers often set -Xms equal to -Xmx, which starts the heap at full size. A lower -Xms lets the heap start small and grow, which suits a server that is often quiet. Either way, -Xmx is the number that decides whether the world fits.

Signs you need more memory, and signs you do not

Check that memory is the problem before buying more of it. Low TPS (ticks per second) on a server with plenty of free memory is a tick-time problem, and more RAM will not change it.

What you seeWhat it points at
java.lang.OutOfMemoryError: Java heap space, or GC overhead limit exceededMemory. The live world no longer fits in the heap.
The server stops with exit code 137 and no Java errorMemory. Heap plus everything outside it crossed the limit.
Can't keep up! Is the server overloaded? while memory is well below the limitTick time, not memory. Ticks are taking longer than the 50 ms the game allows each one.
A single server tick took 60.00 secondsA stuck tick: a chunk or a mod looping, not a memory shortage.
Lag that comes and goes as players exploreWorld generation. Usually the processor first; memory only if the errors above appear.

How to lower memory use before you buy more

  1. Lower view-distance in server.properties by two to four chunks and restart. It is the largest single lever on loaded chunks.
  2. Lower simulation-distance as well, where your version has it. It controls how much of the loaded area is actively ticked, which cuts entity and machine load.
  3. Take client-only mods out of the server's mods folder. Minimap, shader-loader and HUD mods do nothing useful on a server, and some crash it outright.
  4. If memory use creeps up over days with no new players, restart on a schedule and report it to the pack's author. Steady growth on a quiet server often means a mod is holding on to memory it no longer needs.

What MineXHost's launcher does with your memory

MineXEngine, our launcher, sets the Java memory flags for you from your server's real memory limit; you do not type an -Xmx value. It holds back a share of that limit for everything Java needs outside the heap and gives the rest to the heap. The share is larger on small servers, because Java's fixed costs do not shrink with the box.

Server memory limitHeld back outside the heap
2 GB or less38%, and never less than 512 MB
More than 2 GB, up to 4 GB28%
More than 4 GB, up to 8 GB22%
More than 8 GB, up to 16 GB16%
More than 16 GB13%

So a server with an 8 GB limit runs with a heap of about 6.2 GB. The class-memory part of that reserve is sized from your pack's mod count rather than from the RAM: about 2 MB per mod on top of a 192 MB base, capped at 1 GB, and always kept within the reserve, so on a small plan a very large pack gets less than that formula would give it.

The heap starts at a quarter of its maximum and grows when the world needs it, so a quiet server does not hold memory it is not using. If an out-of-memory error does happen, the recovery steps are the ones our OutOfMemoryError guide describes, and the launcher prints what it changed in your console.

Moving to a plan with more memory is a plan change in your account. The server keeps its files and its world and is resized to the new plan, with the new memory limit taking effect on its next restart.

Memory is not the only reason a pack fails to start. Our test results page shows how many public modpacks boot on each MineXEngine version, and how they were tested.

See the modpack test results

MineXHost runs light, medium and heavy modpacks on MineXEngine. Our launcher detects the modpack, picks the right Minecraft loader and Java version, tunes the JVM for your RAM, and auto-recovers from the crashes that normally end a modded server's evening. Pick your RAM, paste the pack, and play.

See hosting plans

Frequently asked questions

How much RAM do I need for a modded Minecraft server?

A modded Minecraft server is usually estimated at about 4 GB for a light pack of 50 to 100 mods, 6 GB for 100 to 200 mods and 8 GB for 200 to 400 or more, plus roughly 0.1 to 0.25 GB for each player online at the same time. These are estimates for smooth play, not measurements of a specific pack, so treat them as a starting point and watch for out-of-memory errors.

Is 4 GB of RAM enough for a modded Minecraft server?

Four gigabytes is our estimated base for a light modpack of about 50 to 100 mods before any players are counted, and our RAM calculator estimates a light pack with three players online at about 5 GB. It is usually too little for medium or heavy packs of 100 mods or more. Java also keeps part of a server's memory outside the heap, a larger share on small servers, so a 4 GB server has noticeably less than 4 GB for the world itself.

Does more RAM make a Minecraft server run faster?

Extra RAM makes a Minecraft server faster only when the server is short of memory; once the world fits, more memory sits unused and does not raise TPS. The game aims for 20 ticks per second and slows down when a tick takes longer than 50 milliseconds, which depends on the work in each tick and the processor doing it. Check for OutOfMemoryError or exit code 137 before buying more.

How much RAM does each player add to a Minecraft server?

Each player online at the same time is usually estimated to add between about 0.05 GB on vanilla and 0.25 GB on the heaviest modpacks, because every player keeps their own area of chunks loaded. Players who stay together share chunks and cost less, while players exploring in different directions each load new terrain and cost more.

Should I set -Xmx to all of my server's RAM?

Setting -Xmx to the full RAM of a server is a mistake, because Java also needs memory outside the heap for loaded classes, compiled code, buffers and the garbage collector, and the operating system kills the process with exit code 137 when the total crosses the limit. Leave a margin. On MineXHost the launcher sizes the heap for you and holds back a share of the limit for exactly this.

What do -Xmx and -Xms mean for a Minecraft server?

The -Xmx option sets the maximum size of the Java heap a Minecraft server may use, and -Xms sets the size the heap starts at, which is also its minimum. Both take a number and a unit such as -Xmx6G, and both go before -jar in the start command or in NeoForge's user_jvm_args.txt. Size -Xmx from your memory estimate and keep it below the machine's total memory.

Still stuck?

Every ticket is answered by a real person who plays Minecraft and knows modpacks. Send the full console output, not just the last line. Customers open a ticket from the panel; anyone can ask in our Discord.

  • Live support 5PM-12AM ET on weekdays
  • Replies typically within 12 hours
  • Limited availability on weekends