Fix "Could not reserve enough space for object heap" in Minecraft
A startup failure from an -Xmx set above free RAM, or from 32-bit Java. Lower -Xmx or install 64-bit Java to get the server booting again.
The error means the JVM couldn't reserve the heap it was asked for at the moment it started up, so it quit before Minecraft ever loaded. You asked for more memory than the machine had free, or you're running 32-bit Java. Lower -Xmx until it fits, or install a 64-bit Java runtime, and it will boot. This is a startup failure, not a running server that ran out of memory mid-game.
The full line usually looks like this:
Error occurred during initialization of VM: Could not reserve enough space for object heap
The keywords to recognize are "Error occurred during initialization of VM" and "Could not reserve enough space for object heap". If you see those, keep reading. If instead your server ran fine for a while and then died, that's a different failure and I'll point you at the right fix below.
Why this isn't an "out of memory" crash
The word "space" makes people assume they're out of RAM and need more. It's the opposite problem. -Xmx is the maximum heap size, the ceiling the JVM promises itself. The JVM reads that number once at startup and immediately tries to reserve that much memory from the operating system. If the OS can't hand over a block that big, the JVM refuses to launch at all. Nothing has loaded yet, so there's no world and no plugins to speak of. It's a boot-time sanity check that failed.
Compare that to java.lang.OutOfMemoryError: Java heap space, which is a different problem entirely: that one comes from a server that already started, ran under normal load, and then grew past its ceiling. That's a runtime crash with a full Java stack trace, and it's covered in Fix "java.lang.OutOfMemoryError: Java heap space". If your logs show a stack trace after the server was up, go there instead. There's also a third look-alike on Linux servers: the OS killing the process and printing a bare Killed with no Java trace at all, which again means the box was over-allocated.
So the "could not reserve" error has exactly two real causes, and it's worth figuring out which one you have before you touch anything.
Cause 1: -Xmx is bigger than the free RAM
This is the usual culprit. Somebody set -Xmx8G on a machine that doesn't have 8GB free to give, or has 8GB total but the OS and other programs are already sitting on a chunk of it. The JVM asks for the whole 8GB up front, the OS says no, and you get the error.
A quick way to tell this is your cause: does it fail at a large -Xmx but start fine at a small one like -Xmx2G? If lowering the number fixes it, you were simply over-allocating.
The rules that keep you out of trouble:
- Never set
-Xmxabove the RAM physically installed in the machine. Sounds obvious, but slider-and-typo mistakes happen constantly. - On a client, give it up to about half your physical RAM and leave 3-4GB free for Windows, your browser, and everything else. An 8GB PC wants 3-4GB, a 16GB PC 6-8GB, a 32GB PC 8-10GB. Vanilla is happy on 2-4GB; a 150+ mod pack wants 6-8GB. The full sizing walkthrough is in How to allocate more RAM to Minecraft (Java client).
- On a server, leave headroom below total RAM. Paper's rule of thumb is to keep
-Xmxroughly 1000-1500MB under the box's total, so an 8GB server gets about-Xmx6500M, not-Xmx8G. See How much RAM does a 20-player server need? for the sizing figures.
One honest wrinkle on 64-bit Java: even when total RAM looks fine, the error can appear if there isn't a single contiguous free block big enough right then, because other apps are holding memory or -Xmx sits a hair under total with the OS already committed. The practical fix is the same either way: lower -Xmx a bit and close whatever else is eating RAM.
Cause 2: you're on 32-bit Java
If the error shows up even at a small heap like -Xmx2G, you're probably running 32-bit Java. A 32-bit JVM can only address a limited chunk of memory, so its heap tops out somewhere around 1.5GB regardless of the number you type. Ask for more than it can address and it refuses to launch with this exact heap-reserve error rather than starting up and failing later.
Most people never hit this because modern launchers and Java installers ship 64-bit by default, but older setups and hand-installed runtimes still trip it. To check, run this in a terminal:
java -version
A 64-bit runtime prints a line containing 64-Bit Server VM. If you don't see "64-Bit" anywhere, or it says "Client VM", you're on 32-bit and that's your problem. The fix is to install a current 64-bit Java runtime (Java 21+ is the modern baseline for servers) from Adoptium or via your launcher, then point the launcher's Java executable at the new install and retest. Once you're on 64-bit, the ~1.5GB ceiling disappears and your -Xmx number is honored for real.
Fix it: lower -Xmx or fix Java
On the official Minecraft launcher: Installations tab, hover the profile, click the three-dots (⋮), Edit, More Options, then edit the JVM Arguments line. The default reads -Xmx2G. Change the number there. The official launcher has no memory slider anymore, so the arguments line is the only place to do it. Remember -Xmx6G and -Xmx6144M mean the same thing (6 × 1024).
On third-party launchers you get sliders, measured in MB:
- Modrinth App: Settings, Java and Memory, drag the Allocated memory slider down.
- Prism Launcher: Settings, Java, Maximum memory allocation for the global default, or per-instance via Edit Instance, Settings, Java (tick the Memory override box first).
- CurseForge: Settings, Minecraft, Allocated Memory slider. It defaults to around 4GB.
On a server, open your start script (.bat on Windows, .sh on Linux) or the start command and lower the -Xmx value so it leaves 1000-1500MB below the machine's total RAM. Save, then relaunch.
Whatever you change, you have to fully close and reopen the game and the launcher, because the JVM reads -Xmx exactly once at startup and a running process keeps its old value forever. To confirm the new number took, join a world and press F3. Top right you'll see a line like Mem: 47% 1878/4096MB. The number after the slash is your allocated total, so it should match what you set.
Still won't start?
The trap that catches people is that the memory setting is per-profile or per-instance. Editing your vanilla profile does nothing for a modded installation, and changing one Prism instance leaves the others untouched. Make sure you edited the exact profile you're actually launching. If you have several installations, check each one.
If a small -Xmx still fails and java -version says you're 64-bit, something else on the machine is hogging RAM at launch time. Close browsers, other games, and background apps, then try again. On a shared or rented server box, another service on the same machine may be sitting on the memory you thought was free.
FAQ
Does this only happen on a certain Minecraft version?
No. It's a JVM and operating-system issue, completely independent of which Minecraft version you're running, so updating or rolling back won't change it either way. The fix is always the same: right-size -Xmx and make sure Java is 64-bit.
Should I set -Xms to match -Xmx?
You can, and a lot of server start scripts set -Xms and -Xmx to the same value so the heap doesn't grow and shrink. Just know that -Xms is the starting heap the JVM reserves immediately, so if you set -Xms bigger than your free RAM you'll trigger this same reserve error at launch. Keep both numbers under what the machine can actually hand over.


