Skip to content
Hosting · Performance

Garbage collector and pauses

Why the server freezes for a couple of seconds at normal TPS: how garbage collection works, how to see it in logs, and what actually helps.

Updated August 13, 2026

Java frees memory in pauses: the application stops, the garbage collector removes garbage, and work continues. A long pause looks like a freeze of the entire server.

Symptoms

  • Average TPS is normal, but once every few minutes everything freezes for 1–5 seconds.
  • In the Paper log: Can't keep up! Did the system time change, or is the server overloaded? — analysis.
  • spark health shows the share of time spent in GC.

What affects it

FactorEffect
Heap sizeLarger heap — longer pause
Garbage creation ratePlugins and mods that create objects in a loop
CollectorG1 by default; ZGC gives short pauses on large heaps
Number of coresParallel collection is faster

What to do

  1. Don't give memory “with a bigger margin”. 32 GB where 8 is enough means longer pauses. A guideline is peak plus 30–50% — How much memory is needed.
  2. Find the source of garbage. spark heapsummary will show what fills the heap. Often it's a specific plugin or mod.
  3. Flags. A tuned G1 is already set in Millida; manual sets from the internet more often do harm — Aikar's flags.

What not to do

Don't try to “disable the garbage collector” — it doesn't exist as an option. Don't set -Xmx higher than the plan's amount of memory: the process will be killed when it tries to exceed the limit — OutOfMemoryError.

Minecraft hostingYour server runs while you are offlineCreate server