Guide
Minecraft Server RAM Allocation
Minecraft server RAM allocation is the setting that decides whether a modded server feels responsive or miserable, and it is also the setting people most often get wrong in both directions. Too little produces lag and crashes; too much produces long garbage-collection pauses that feel like lag but are not.
Below are the figures that hold up in practice, where to change them, and how to tell whether memory is genuinely the constraint before you pay for more of it.
Mod count matters far more than player count
The intuition most people bring is that a server needs memory in proportion to how many people are on it. That is not how modded Minecraft behaves, and starting from the wrong model leads to buying the wrong plan.
The dominant cost is the mod list. Every mod registers blocks, items, recipes and entity types at startup, and those registries stay resident for the life of the process regardless of whether anyone is connected. A three-hundred-mod pack consumes several gigabytes before a single player joins.
Players add cost, but they add it in loaded chunks rather than in fixed overhead. Each player keeps the chunks around them loaded and ticking, which is real but comparatively modest — roughly half a gigabyte each once you are past the first handful.
So the honest way to size a server is to start from the pack and add a per-player margin, not the other way round.
The figures worth starting from
These are conservative starting points rather than minimums. A server running slightly above what it needs behaves noticeably better than one running exactly at the limit, because the garbage collector has room to work in short bursts rather than long stalls.
If you land between two rows, take the higher one. The cost difference between a 4GB and a 6GB plan is usually a couple of pounds a month, and the experience difference is substantial.
| Server type | Base RAM | Per extra player past 4 |
|---|---|---|
| Vanilla | 1–2GB | +250MB |
| Light mod list (20–40) | 3GB | +300MB |
| Medium pack (50–100) | 4GB | +400MB |
| Large pack (100–200) | 6GB | +500MB |
| Kitchen sink (250+) | 8GB | +500MB |
| Heavy worldgen mods | +1–2GB | on top of the above |
Why over-allocating makes things worse
This is the part that surprises people, because every other resource in computing behaves as though more is better.
Java manages memory with a garbage collector that periodically walks the heap to find objects nothing references any more. The larger the heap, the longer that walk takes. On a small heap the collector runs often and finishes quickly; on an enormous one it runs rarely and stops the world for noticeably longer when it does.
On a server, a long collection pause is indistinguishable from lag. Everyone rubber-bands, mobs freeze, and the console reports that the server cannot keep up. Raising the allocation further makes the pauses longer still, which is why this failure mode is so persistent — the obvious response worsens it.
There is also a straightforward resource argument. On a machine with 16GB, allocating 14GB to the server leaves the operating system paging to disk, and disk paging is far slower than anything you gained.
Setting it on a self-hosted server
A self-hosted server is started from a script, and the allocation lives in that script as two JVM flags.
The flag that matters is -Xmx, which caps the heap. -Xms sets the starting size, and on a server it is genuinely worth setting equal to -Xmx: the heap will grow to that size anyway, and pre-allocating avoids a series of expensive resizes during the first hour.
Edit the script, change both numbers, and restart. There is no other place the value can come from, which makes self-hosting simpler to reason about than a control panel.
A sane server start line
java -Xmx6G -Xms6G -jar server.jar nogui
# -Xmx hard ceiling on the heap
# -Xms starting heap, set equal on a server
# nogui saves a little memory by skipping the windowSetting it on a rented server
On a rented server the allocation is usually fixed by the plan you bought, and the control panel simply reports it rather than letting you change it.
Some hosts expose a slider that lets you allocate less than your plan provides, which is occasionally useful — a pack that behaves badly at 8GB sometimes behaves better at 6GB for exactly the collection-pause reason above.
What you can usually change is the Java version and sometimes the garbage collector flags. If your host offers a Java version selector, match it to your Minecraft version rather than leaving it on whatever the default is.
If you need more memory, that is a plan upgrade rather than a setting, and most hosts prorate it within a billing period.
Telling whether RAM is actually your problem
Before upgrading anything, find out whether memory is the constraint. It frequently is not, and the symptoms of a CPU-bound server look very similar from a player's seat.
The console message 'Can't keep up! Is the server overloaded?' means a tick exceeded its 50ms budget. That is a symptom, not a cause — it happens under memory pressure and under CPU pressure equally.
The distinguishing evidence is the memory graph. Most control panels show heap usage over time. A healthy server shows a sawtooth: usage climbs, the collector runs, usage drops sharply back to a stable baseline. A memory-constrained server shows a sawtooth whose low points keep creeping upward until it hits the ceiling.
If the low points are flat and you are still lagging, the problem is CPU or a specific mod, and more memory will change nothing.
Cutting demand before buying more
Two settings in server.properties reduce memory and CPU load substantially, and both cost less in experience than people expect.
View distance is the large one and it scales with the square of the value. Going from 12 chunks to 8 removes more than half the chunk data the server holds. On a modded server 8 is comfortable, and most players will not notice the change during normal play.
Simulation distance controls how far out entities and blocks continue ticking. Lowering it to 6 stops the server simulating farms and mob spawners nobody is standing near, which on a busy world is a large saving.
Adjust these first. They are free, reversible, and frequently make an upgrade unnecessary.
server.properties — the two settings that matter
view-distance=8
simulation-distance=6
# Both are quadratic in cost.
# Halving view distance removes roughly three quarters of the work.Chunk loaders are the usual hidden cost
If a server's memory use climbs steadily over days and never comes back down, the cause is very often chunk loaders rather than a leak.
Many tech mods provide blocks that keep chunks loaded permanently so machines keep running while nobody is there. Each one adds permanently resident chunk data, and on a server where six players have each built three bases, that adds up quickly.
This is legitimate behaviour rather than a bug, but it means memory requirements grow with how long the server has been played rather than staying flat. A pack that was comfortable at 6GB in month one can genuinely need 8GB by month four.
Most packs include a way to audit loaded chunks. Finding the forgotten base still loading a dozen chunks is a common and satisfying fix.
Garbage collector flags, and why to ignore most advice about them
Search for Minecraft server JVM flags and you will find long argument strings promising dramatic improvements. Most of them are a decade old and tune collectors that are no longer the default.
Modern Java uses G1GC by default, which is well suited to this workload and needs very little tuning. Copying flags written for an older collector can silently disable the sensible defaults and make performance worse.
The one adjustment with a real reputation is the Aikar flag set, which is genuinely maintained and genuinely tested against Minecraft servers. If you want to tune, use that rather than an assembled collection from a forum post.
Otherwise, set -Xmx and -Xms and leave the rest alone. The gains available from flag tuning are small compared with fixing view distance or finding a misbehaving mod.
Sizing for a pack you have not run yet
When installing a new pack, the pack's own page is the best source. Most authors publish a recommended server allocation, and it is more reliable than a generic estimate because they know what the pack does.
Where no figure is given, use the mod count and the table above, then add a gigabyte. Running slightly over on the first week costs little and removes memory from the list of suspects while you find out how the pack behaves.
Once it is stable, watch the memory graph across a few sessions. If the baseline sits well below the ceiling, you can safely come down a plan tier at the next billing cycle.
A short sizing routine
Start from the pack's recommendation, or the table if there is none. Add a per-player margin if you expect more than four concurrent players. Set -Xmx and -Xms equal. Lower view distance to 8 and simulation distance to 6 before considering any upgrade. Watch the memory graph for a week and adjust once you have evidence rather than guesses.
That sequence resolves the large majority of modded server performance complaints without spending anything.
- Take the pack's own recommended figure if published.
- Otherwise size from mod count using the table.
- Add roughly 500MB per player past the first four.
- Set -Xmx and -Xms to the same value.
- Lower view distance to 8, simulation to 6.
- Watch the heap graph before upgrading anything.
Questions people actually ask
- How much RAM does a modded Minecraft server need?
- 3GB for a light mod list, 4GB for 50–100 mods, 6GB for 100–200, and 8GB for kitchen-sink packs, plus roughly 500MB per concurrent player beyond the first four.
- Is more RAM always better for a Minecraft server?
- No. Past roughly 8–10GB, garbage-collection pauses get long enough to feel like lag, and taking too much starves the host operating system. If 8GB is not enough, look for a misbehaving mod.
- Should -Xms equal -Xmx on a server?
- Yes. The heap will grow to the maximum anyway, and pre-allocating avoids a series of expensive resizes during the first hour of uptime.
- Why does my server lag even with plenty of RAM?
- Because memory is probably not the constraint. Check the heap graph — if its low points are flat rather than creeping upward, the bottleneck is CPU or a specific mod, and more memory will not help.
- Does view distance affect server RAM?
- Substantially, and the cost scales with the square of the value. Dropping from 12 to 8 chunks removes more than half the chunk data the server holds resident.
- Why does memory use grow over weeks?
- Usually chunk loaders from tech mods keeping player bases permanently active. This is normal behaviour rather than a leak, but it means requirements grow with how long the server has been played.
- Should I use custom JVM flags?
- Generally no. Most flag strings online tune collectors that are no longer default and can make things worse. If you want to tune, use the maintained Aikar flag set rather than an assembled list.
- How do I know if the server is short on memory?
- Watch the heap graph over a session. Healthy is a sawtooth returning to a stable baseline. Low points that keep rising until the ceiling indicate genuine memory pressure.
- Can I run a modded server on 2GB?
- Only for a very light mod list, and even then it will be tight. Most packs described as modpacks need at least 4GB.
- Does the server need as much RAM as the client?
- Different amounts for different reasons. The server holds every loaded chunk for every player but does no rendering; the client renders but only holds what one player can see.
Sources & further reading
Read next
- How to Make a Modded Minecraft Server
How to make a modded Minecraft server: self-host it free on your own PC, or rent one. Covers RAM, port forwarding, mod syncing and what Realms cannot do.
- Minecraft Out of Memory Error: Allocate RAM Properly
Minecraft out of memory error explained: how much RAM to allocate for your mod count, where to change it in each launcher, and why more is not always better.
- How to Play Modded Minecraft With Friends
How to play modded Minecraft with friends: LAN, Essential, self-hosted servers and rented ones, what each costs, and why Realms will not work.
- The Best Minecraft Modpacks and How to Pick One
The best Minecraft modpacks sorted by what they actually demand — time, RAM and patience — rather than by hype. Plus how to install one in about five minutes.
Back to the full How to Mod Minecraft guide for the whole install walkthrough from the beginning.

Sukie · Editor
Sukie runs How to Mod Minecraft. She writes and edits every guide on the site, works through each install path herself before publishing, and rewrites anything that turns out to be wrong. The focus here is narrow on purpose: getting mods, loaders and modded servers working without wading through forum threads.
About this site · How guides are checked · Last updated September 4, 2026
NOT AN OFFICIAL MINECRAFT PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.