How to Allocate More RAM to a Minecraft Server
Whether you are fixing crashes or just adding a big modpack, your Minecraft server needs the right amount of RAM allocated. Here is how to do it — in a start script and in a control panel — and how much to give.
-Xmx sets the MAXIMUM RAM the server can use; -Xms sets the starting amount. For a dedicated game server, setting both the same (e.g. -Xmx6G -Xms6G) is common and avoids resizing pauses.
Method 1: in your start command / script
If you run the server yourself, the RAM is set by the -Xmx and -Xms flags in your launch command:
java -Xms6G -Xmx6G -jar server.jar nogui
That gives the server 6 GB. Change the number (e.g. 4G, 8G) to suit. Always leave 1–2 GB free for the operating system — never allocate all of the machine's RAM.
Method 2: in a control panel
Most hosts use a panel, so you never touch the command line:
- Pterodactyl — set the memory limit on the server; it applies the
-Xmxautomatically. - Multicraft — set the maximum memory in the server settings.
- Other panels — look for a "Memory" or "RAM" field, then restart.
On shared hosting your plan's RAM is the ceiling — to go higher you upgrade the plan.
How much RAM should you allocate?
- Vanilla / Paper, a few players — 2–4 GB.
- Plugins + 10–30 players — 4–6 GB.
- Medium modpacks — 6–8 GB.
- Large modpacks (All the Mods, RLCraft, Create) — 8–10 GB or more.
More is not always better — beyond what the server needs, extra RAM just sits unused, and very large heaps can even cause longer pauses. Match the RAM to the workload.
After changing RAM
Restart the server for the new value to take effect, then watch for the OutOfMemoryError crash. If it still runs out, you may have a leaking mod or simply need a bigger plan. Pair the right RAM with good settings for smooth TPS.
Give the server what its workload needs plus a little headroom — and always leave RAM for the OS. Bigger is not automatically better.
Minecraft is a trademark of Mojang Synergies AB / Microsoft. ESAGAMES is an independent hosting provider, not affiliated with or endorsed by Mojang or Microsoft.
The right RAM, instantly
Pick a Minecraft plan with the RAM your pack needs — high-clock CPUs, NVMe and DDoS protection included.
Frequently asked questions
How do I allocate more RAM in Pterodactyl?
Edit the server's memory limit in the panel (or ask your host to raise it). Pterodactyl applies the -Xmx flag automatically based on that limit; then restart the server.
Should -Xmx and -Xms be the same value?
For a dedicated game server, yes — setting them equal (e.g. -Xms6G -Xmx6G) avoids the pauses Java takes when it resizes the heap, giving smoother performance.
Can I allocate all of my server's RAM to Minecraft?
No — always leave 1–2 GB for the operating system and other processes. Allocating 100% of RAM can make the whole machine unstable or trigger the OOM killer.
Related articles
Fix Minecraft "java.lang.OutOfMemoryError: Java heap space"
Server crashing with "OutOfMemoryError: Java heap space"? What it means and how to fix it for good.
Read fix Game ServersFix AMX Mod X "Couldn't load library" / Plugin Failed in CS 1.6
AMXX plugin stuck on "bad load", "couldn't load library" or "failed"? The real causes and the exact fix.
Read fix Game ServersFix FiveM "Couldn't load resource" / Failed to Start
A FiveM resource won't start or throws "couldn't load resource"? Here are the real causes and fixes.
Read fix