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 readUpdated 2026-09-14Diese Anleitung auf Deutsch lesen →

How it shows

  • The panel's memory bar sits at the limit; the server restarts or goes offline without an error line.
  • 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. 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.

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 (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.