How to Allocate More RAM to Minecraft (2026)

Published on | Updated

Step-by-step guide to give Minecraft more RAM on client and server. Fix lag and crashes from insufficient memory.

Allocate more RAM Minecraft

Minecraft runs on Java, and Java needs RAM allocated upfront. If you see "Out of Memory" errors, lag spikes, or crashes, you likely need to allocate more RAM. Here is how, first for the game on your own PC and then for a server.

For the Minecraft Client

Official Launcher

  1. Open the Minecraft Launcher
  2. Go to Installations
  3. Click the three dots on your profile, then Edit
  4. Click More Options
  5. Find the JVM Arguments field
  6. Change the number after -Xmx to the amount you want, for example -Xmx2G to -Xmx4G for 4 GB
  7. Save

Prism Launcher

  1. Open Settings
  2. Go to Java
  3. Set the maximum memory under Memory
  4. Click OK

CurseForge App

  1. Click the settings gear in the lower left corner
  2. Open the Minecraft tab
  3. Under Java Settings, move the memory slider to the amount you want. CurseForge saves the change by itself

For a single modpack only, open My Modpacks, click the three dots on the profile, choose Profile Options and turn on Custom RAM Allocation.

For Minecraft Servers

A server works the same way, with two Java flags:

FlagMeaning
-XmsMinimum RAM (starting allocation)
-XmxMaximum RAM (upper limit). This is the number you raise to add RAM

If you only set -Xmx2G, the server can never use more than 2 GB, however much memory the machine has.

Edit the Start Script

Your server start script contains the RAM allocation:

java -Xms4G -Xmx4G -jar server.jar nogui

Change the numbers to allocate more:

java -Xms6G -Xmx6G -jar server.jar nogui

Save the file and restart the server.

Forge and NeoForge servers usually start with run.sh or run.bat, which read the memory flags from user_jvm_args.txt. Edit the -Xmx line in that file instead, because it decides how much the server gets.

Leave room for Java itself and the operating system. PaperMC advises setting -Xmx and -Xms about 1000 to 1500 MB below the memory you have: "Do you have 8GB of memory? Use 6500MB for safety."

With a Hosting Provider

On a hosted server the plan sets how much memory the server may use, so adding RAM means moving to a bigger plan. On a Space-Node Minecraft server you upgrade from the client area and keep your world, and you can see and change the startup flags yourself in the Startup tab of the panel.

How Much RAM Do You Need

Client

SetupRecommended RAM
Vanilla2 to 3 GB
Light mods (10 to 30 mods)3 to 4 GB
Heavy mods (50+ mods)4 to 6 GB
Heavy mods + shaders6 to 8 GB

Server

SetupPlayersRecommended RAM
Vanilla1 to 102 to 4 GB
Paper + plugins10 to 304 to 6 GB
Light modpack5 to 156 to 8 GB
Heavy modpack such as ATM101 to 1512 to 16 GB
Heavy modpack15+16 GB or more

ATM10's own server files set an 8 GB Java heap, and Java needs memory on top of that, which is why we start that pack at 12 GB. Our server RAM guide goes through the sizing in more detail.

More RAM does not make a server faster on its own. It prevents crashes when the server needs the memory, and past that point it does nothing for TPS.

Common Mistakes

Allocating Too Much RAM

More is not always better. Prism Launcher's documentation puts it bluntly: more RAM allocated does not mean better performance, and outside big modpacks 4 GB should be more than enough. PaperMC says the same for servers: above a certain point you hit diminishing returns. On your own PC, every gigabyte you hand to Minecraft is one that Windows, your browser and Discord no longer have.

Not Setting Xms Equal to Xmx (Servers)

For servers, set -Xms and -Xmx to the same value. PaperMC's guide to Aikar's flags recommends it: with G1, the collector those flags use, unused memory is wasted memory.

Running an Old 32-bit Java

A 32-bit Java can only use a small heap, whatever you type after -Xmx. Current Minecraft rules it out anyway: Mojang's 1.20.5 changelog says the game "now requires a 64-bit Operating System", and Java 25, which 26.1 and newer need, no longer has a 32-bit x86 port at all (JEP 503). The launcher brings its own 64-bit Java; on a server, check that java -version mentions a 64-Bit VM.

Fixing Out-of-Memory Crashes on a Server

If the server still runs out of memory after you added RAM:

  1. Check that the new limit applied: /spark health shows the memory the server can use.
  2. Lower view distance and simulation distance. Our simulation distance guide has starting values.
  3. Pregenerate the world, so the server is not generating terrain under load.
  4. Look for a plugin or mod that leaks memory: /spark heapsummary shows which kinds of objects fill the heap.

Checking Current RAM Usage

In-Game

Press F3 to open the debug screen. The top right shows memory usage, the used and the allocated amount.

Server

Run /spark health. Spark is built into Paper 1.21 and newer, and our spark guide covers the other server types. /tps on Paper only shows the tick rate, not memory.


Get the RAM your server needs. View Minecraft Hosting Plans