Allocate more RAM to Minecraft: how much and how

Minecraft lagging or crashing with mods? How to give the game more memory (RAM) in the official launcher, CurseForge or Modrinth, and how much to give without slowing your PC.

Zaktualizowano dnia

Minecraft Java uses 2 GB of memory by default. That is enough for the base game, but too little with mods, shaders or a long render distance: the game stutters, freezes for a few seconds or crashes with an "Out of memory" error.

1. How much RAM to give?

  • Game without mods: 2 to 4 GB.
  • A few mods or shaders: 4 to 6 GB.
  • Big modpack: 6 to 8 GB, as the modpack recommends.

Never give more than half of your computer's memory: Windows and other programs need some too. Too much RAM can even slow the game down. To see how much memory your PC has: Settings → System → About (Windows), or Apple menu → About This Mac.

2. In the official Minecraft launcher

  1. Open the Installations tab.
  2. Hover the installation you use, click the three dots then Edytuj.
  3. Click More options.
  4. In JVM arguments, find -Xmx2G at the start of the line and change the number, for example -Xmx4G for 4 GB. Leave the rest of the line as it is.
  5. Save and restart the game.

3. In CurseForge or the Modrinth App

  • CurseForge: Settings → Minecraft → Allocated Memory, a slider to set.
  • Modrinth App: in the settings (global or per instance), Java and memory section, memory slider.

4. Still lagging?

  • Install Sodium (Fabric), which greatly improves frames per second: see how to install mods.
  • Lower the render distance and the quality of the shaders.
  • If the game only lags on a server (blocks snapping back, players teleporting), it is often the connection or the server itself: see server connection problems.

On Bedrock (mobile, consoles, Windows), there is no memory setting: the game handles it itself.

Czy prowadzisz serwer Minecraft?

Wystaw ją za darmo, a gracze ją odkryją.

Inne przewodniki