# How to allocate more RAM to Minecraft and stop out of memory crashes

> Markdown version of https://stella.sh/how/game-mods/allocate-more-ram-to-minecraft for agents and LLMs.
> Fix a modpack that crashes out of memory: raise -Xmx in the launcher's JVM arguments or CurseForge's memory slider, or let Stella (stella.sh) set a safe amount.

In the official Minecraft Launcher, go to Installations, hover the modpack, click the three dots, Edit, More Options, and change `-Xmx2G` in JVM Arguments to `-Xmx6G`. In CurseForge, use Settings, Minecraft, Java Settings, Allocated Memory. 6 to 8 GB suits most modpacks; never give it more than half your computer's memory. Stella (stella.sh) reads the crash log to confirm memory is the cause, then raises it to a safe amount.

- Checked: 13 November 2026
- Stella does it on: Windows, Mac, Linux

## Stella doing it

Recorded 13 November 2026 on Linux (Omarchy) with Claude Code with Opus, on a Claude plan.
Result: The modpack's profile raised from 2 GB to 6 GB in about 1 minute 30 seconds. Checked afterwards against an answer key written before the run, at file level: launcher_profiles.json is still valid, the modpack profile has exactly one -Xmx, at 6 GB, with its original G1 flags kept, and the other profiles and launcher settings are unchanged. Checked in the files only. The test computer has a realistic launcher folder with a 20-mod pack, a crash report and an out-of-memory log, but no copy of the game, so Minecraft wasn't launched to confirm the crash is gone. The work is sped up 2×.

Video (58 s): https://stella.sh/media/proofs/game-mods/allocate-more-ram-to-minecraft/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer, with a Minecraft folder whose modpack crashed out of memory.
- 0:02 The prompt: it keeps crashing with an out of memory error, give it more RAM.
- 0:25 Stella replies: it'll check the crash log to confirm low memory is the cause, raise the limit to a safe amount, and not start the game.
- 0:31 Reading the crash log and editing the launcher profile, sped up 2×.
- 0:43 Done: 2 GB to 6 GB for the modpack, why 6 GB, what to do before playing, and what a crash at 6 GB would mean.

What Stella does:

1. Finds the launcher that runs the modpack and reads the crash report: the pack hit its 2 GB cap while loading the world
2. Checks how much memory the computer has (about 62 GB on the test computer) and how big the pack is (20 mods) before choosing a number
3. Changes `-Xmx2G` to `-Xmx6G` on the modpack's profile only, keeping its other Java flags and every other profile as they were
4. Backs up the launcher settings first, so the change is easy to undo
5. Doesn't start the game, and tells you to keep the launcher closed until you play, because it can overwrite the change when it closes

## The prompt to paste

```text
Minecraft keeps crashing with an out of memory error when I play my modpack. Can you give it more RAM?
```

## Change it yourself

1. **Make sure it's really memory.** Open the newest file in the pack's crash-reports folder, or logs/latest.log, and search for OutOfMemoryError or “Java heap space”. If the crash names a mod or a missing dependency instead, more RAM won't help.
2. **Official launcher: edit the JVM arguments.** Open the Minecraft Launcher, choose Installations, hover over the modpack's installation, click the three dots, Edit, then More Options. In JVM Arguments, change the number in `-Xmx2G` to `-Xmx6G`, leave the rest of the line alone, and click Save.
3. **CurseForge, Prism and other launchers.** In the CurseForge app, go to Settings, Minecraft, Java Settings and move the Allocated Memory slider; it applies to all its modpacks. Prism Launcher and the Modrinth app set memory per instance in that instance's settings.
4. **Pick a sensible amount.** About 4 GB is plenty for unmodded play and 6 to 8 GB for most modpacks; go higher only for very large packs. Leave at least half your computer's memory for everything else: on an 8 GB laptop, 4 GB is the ceiling. Far too much can cause longer stutters.
5. **Test it.** Start the modpack and load the world that crashed. Press F3: the Mem line shows the new maximum. If it still crashes with memory to spare, a mod is probably leaking memory; check that mod's issue tracker.

## Where Stella stops

- Checked in the files only: the test computer had no copy of Minecraft, so the game wasn't launched and the fix wasn't play-tested.
- More RAM only fixes out-of-memory crashes. Stella read the crash log first for that reason; a crash from a broken or mismatched mod needs a different fix.
- It edits the official launcher's settings file, which the launcher can overwrite if it's open at the time. Close it before asking.
- Recorded on Linux, where the game folder is ~/.minecraft. On Windows it's %APPDATA%\.minecraft and on a Mac ~/Library/Application Support/minecraft; other launchers keep their own settings, which this run didn't cover.
- The crash log and launcher settings go to the AI model you use in Stella while it reads them.

## Questions

**How much RAM should I give Minecraft?**
About 2 to 4 GB for unmodded play, 6 to 8 GB for most modpacks, and never more than half your computer's memory. Past that point more isn't better: it can make the game pause for longer.

**Why does it still run out of memory after I added RAM?**
Either the change didn't stick (the launcher was open and overwrote it), it went on a different installation, or a mod is leaking memory. The F3 screen's Mem line tells you whether the new limit is in effect.

**Do I need 64-bit Java?**
Only if you set a custom Java path: 32-bit Java can't use more than about 1.5 GB. The official launcher's bundled Java is 64-bit, so most players never need to think about it.

**What if the modpack crashes with exit code 1 instead?**
Then it's usually a missing or mismatched mod, not memory. See [modpack crashing with exit code 1](https://stella.sh/how/game-mods/minecraft-modpack-exit-code-1). Textures not loading is a different fix: [install a resource pack](https://stella.sh/how/game-mods/install-minecraft-resource-pack).

**Is Stella free for this?**
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.

**Can I control what Stella changes on my computer?**
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.

Sources: [Nodecraft: How to allocate more RAM to Minecraft launchers](https://nodecraft.com/support/games/minecraft/how-to-allocate-more-ram-to-minecraft-launchers), [CurseForge: How to allocate more RAM to Minecraft](https://blog.curseforge.com/how-to-allocate-more-ram-to-minecraft/).

## Related problems

- [Minecraft modpack crashing with exit code 1? Find the real error](https://stella.sh/how/game-mods/minecraft-modpack-exit-code-1.md)
- [How to install a Minecraft resource pack that isn't showing up](https://stella.sh/how/game-mods/install-minecraft-resource-pack.md)
- [Install Sodium and Iris on Minecraft 1.21 (Fabric)](https://stella.sh/how/game-mods/install-sodium-iris-minecraft-1-21-fabric.md)
- [How to install Minecraft mods, and why yours don't show up](https://stella.sh/how/game-mods/install-minecraft-mods.md)
- [Minecraft shaders not showing up in the Shader Packs list](https://stella.sh/how/game-mods/install-minecraft-shaders.md)
- [Install a downloaded Minecraft map so it shows up in Singleplayer](https://stella.sh/how/game-mods/install-minecraft-map.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
