How to Allocate More RAM to Minecraft (2026)

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.
For the Minecraft Client
Official Launcher
- Open the Minecraft Launcher
- Go to Installations
- Click the three dots on your profile, then Edit
- Click More Options
- Find the JVM Arguments field
- Change
-Xmx2Gto your desired amount (e.g.,-Xmx4Gfor 4 GB) - Save
Prism Launcher
- Open Settings
- Go to Java
- Set Maximum memory allocation to your desired amount
- Click OK
CurseForge / Overwolf
- Open Settings (gear icon)
- Go to Minecraft
- Find Allocated Memory slider
- Drag to desired amount
For Minecraft Servers
Edit the Start Script
Your server start script contains the RAM allocation:
java -Xms4G -Xmx4G -jar server.jar nogui
| Flag | Meaning | |------|---------| | -Xms | Minimum RAM (starting allocation) | | -Xmx | Maximum RAM (upper limit) |
Change the numbers to allocate more:
java -Xms6G -Xmx6G -jar server.jar nogui
With a Hosting Provider
Most hosting control panels have a RAM slider or plan upgrade option. Check your hosting dashboard to increase the allocation.
How Much RAM Do You Need
Client
| Setup | Recommended RAM | |-------|----------------| | Vanilla | 2 to 3 GB | | Light mods (10 to 30 mods) | 3 to 4 GB | | Heavy mods (50+ mods) | 4 to 6 GB | | Heavy mods + shaders | 6 to 8 GB |
Server
| Setup | Players | Recommended RAM | |-------|---------|----------------| | Vanilla | 1 to 10 | 2 to 4 GB | | Paper + plugins | 10 to 30 | 4 to 6 GB | | Light modpack | 5 to 15 | 6 to 8 GB | | Heavy modpack | 10 to 30 | 8 to 12 GB | | Heavy modpack | 30+ | 12 to 16 GB |
Common Mistakes
Allocating Too Much RAM
More is not always better. Allocating 16 GB to a client that needs 4 GB causes longer garbage collection pauses and worse performance.
Not Setting Xms Equal to Xmx (Servers)
For servers, set -Xms and -Xmx to the same value. This prevents Java from constantly resizing the heap.
Using 32-bit Java
32-bit Java limits you to ~1.5 GB regardless of settings. Make sure you have 64-bit Java installed.
Checking Current RAM Usage
In-Game
Press F3 to open the debug screen. The top-right shows memory usage like 1234/2048 MB. This tells you current/allocated.
Server
Use the /tps command or Spark profiler to monitor memory usage on the server side.
Get the RAM your server needs. View Minecraft Hosting Plans
