Out of memory: understand and fix it

How to tell that RAM is the problem, what eats it, and the order of fixes from free to upgrade.

1 min readDiese Anleitung auf Deutsch lesen

On this page 4
  1. How it shows
  2. Why
  3. Fixes, cheapest first
  4. Not the fix

How it shows

  • The RAM display in the console sits at the limit; the server is stopped and restarts, often without an error line. Afterwards the server management shows a red notice that the RAM was full, with an Upgrade server button.
  • Minecraft: java.lang.OutOfMemoryError: Java heap space or GC overhead limit exceeded in the log; lag spikes every few seconds before the crash (garbage collection).
  • Steam games: exit code 137 in the console, nothing else.

Why

The container has exactly the RAM you bought. RAM and swap count together as one limit, and the dashboard shows one number for it. Java servers use it for loaded chunks, entities, plugins and mods; Rust/ARK/Palworld for the map and entities. When the need exceeds the limit, the kernel kills the process (out of memory) and the server restarts.

Fixes, cheapest first

  1. Reduce what is loaded: lower view-distance and simulation-distance, remove unused plugins/mods, cap entities. See Performance.
  2. Pre-generate instead of generating during play; generation is a memory spike.
  3. Nightly restart: many servers leak slowly (Palworld, some Forge mods).
  4. Upgrade RAM in the dashboard or straight from Upgrade server in the red notice (prorated, applies on restart). For modpacks and Steam games this is usually the honest answer: they need what they need.

Not the fix

Setting a bigger -Xmx than the plan has. The JVM will happily try to use it and get killed at the container limit.

Still stuck?

Kowalski, the assistant in your dashboard, reads your server's log and fixes most things on request. For everything else there is the ticket system.