How to give a Minecraft server more RAM

Allocate more RAM to a Minecraft server and fix "OutOfMemoryError: Java heap space": the -Xmx and -Xms flags, memory on a hosted panel, how much RAM each setup needs, and when RAM is not the fix.

  • 1:21 video
  • English captions & transcript
  • 20 October 2026

Transcript

The full narration, chapter by chapter. Click a time to play the video from there.

Intro

Need more RAM for your Minecraft server, or seeing "OutOfMemoryError: Java heap space"? Here's how to fix both.

The error

That error means the server needed more memory than its limit allowed, so Java crashed it.

Xmx and Xms

The limit is set in the start command. -Xmx is the maximum RAM, and -Xms is the starting amount. Set both the same, for example 6G. And always leave one or two gigabytes for the operating system.

On a panel

On a hosted panel, the memory comes from your plan, and the panel applies it for you. To go higher, upgrade the plan, then restart the server.

How much?

How much do you need? Two to four gigabytes for vanilla or Paper. Four to six with plugins and more players. Six to eight for medium modpacks. And eight to ten, or more, for big ones. More isn't always better.

When RAM isn't the fix

If memory keeps climbing until it crashes, no matter how much you give it, a mod or plugin is probably leaking. Lower the view distance, and pre-generate the world. And if the server lags with plenty of free RAM, the bottleneck is the CPU, not memory.

Recap

Quick recap: raise -Xmx, leave room for the system, and match the RAM to your modpack. Minecraft hosting at esagames.ro.

More video tutorials

  • 1:09
    Minecraft

    Best Minecraft modpacks to host in 2026

    The Minecraft modpacks worth hosting in 2026 and the RAM each needs: All The Mods 10, RLCraft, Create packs, Vault Hunters, Pixelmon, Better MC and Prominence, plus the RAM rule of thumb by mod count.

  • 1:02
    Minecraft

    Fix "Outdated server" / "Outdated client" in Minecraft

    What "Outdated server" and "Outdated client" mean, how to create a launcher installation with the server's exact version, ViaVersion and ViaBackwards for server owners, and why modded servers need the exact same modpack.

  • 1:01
    Minecraft

    Fix Minecraft "You need to agree to the EULA"

    Why a new Minecraft server stops on its first start and the one-line fix: change eula=false to eula=true in eula.txt (or flip the panel EULA toggle), plus what to do when eula.txt is missing or will not save.

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.