Skip to content
Tickwise
CriticalMemorySIG-MEM-002

Metaspace exhausted (OutOfMemoryError: Metaspace)

Platforms
Paper · Purpur · single server
Verified
Verified
Confidence
Confidence 90%

What it looks like in the log

Any one of these lines is enough. The agent matches them locally, on your server.

logs/latest.log
  • [WARN] java.lang.OutOfMemoryError:

Symptoms

  • After /reload or reloading plugins with PlugMan, the server crashes or plugins fail to enable
  • In the log: “java.lang.OutOfMemoryError: Metaspace” or “Compressed class space”

Cause

Memory for class metadata has run out. Usually caused by class loader leaks from /reload or hot-reloading plugins, less often by a -XX:MaxMetaspaceSize that is set too low.

Possible causes

  • Repeated /reload or PlugMan reload: old plugin class loaders are not released
  • -XX:MaxMetaspaceSize / CompressedClassSpaceSize is set too low
  • A plugin generates classes at runtime (scripts, proxies) and does not release them

How to fixLow risk

  1. Fully restart the server (not /reload).
  2. Stop using /reload and PlugMan reloads — update plugins only with the server stopped.
  3. Check the JVM flags: if -XX:MaxMetaspaceSize is set, increase it or remove the limit.
  4. If OOM recurs without reloads, find the plugin that generates classes (/spark heapsummary, a growing number of loaded classes).

Translated from the Russian original; log lines are quoted verbatim.

Sources