Symptoms: java.lang.OutOfMemoryError, Server ran out of memory, GC overhead limit exceeded

Possible Causes

  • Not enough RAM allocated to the server
  • The Xmx value is too low
  • A plugin with a memory leak
  • Too many loaded worlds

Step-by-Step Fix

Step 1

Raise the -Xmx value in your start script. Allocate around 70% of your VPS RAM capacity

bash
-Xms4G -Xmx4G

Step 2

Identify the memory-hungry plugins with Spark

bash
/spark heapsummary

Step 3

Keep the Xms and Xmx values equal — different values create extra problems

Step 4

Remove worlds you do not need and schedule regular restarts (once or twice a day)

Step 5

If the RAM still is not enough, upgrade your VPS plan or drop the plugins you do not need