Garbage collection pauses

Performance & Lag Reviewed September 6, 2026 2 min read

If your server freezes completely for a second or two and then carries on as if nothing happened, that pattern has a specific cause and it is not a plugin.

What you are seeing

  • Everything stops at once — mobs, chat, block breaking — then resumes normally.
  • It happens at intervals rather than constantly.
  • TPS averages look acceptable because the freeze is short and the rest of the minute is fine.

Why it happens

Java reclaims unused memory in cycles. When the heap is large or nearly full, some of those cycles have to stop every thread while they work. The server is not slow during a pause — it is stopped.

What to do

  1. Confirm it with the log

    The server logs Can't keep up! Is the server overloaded? with a duration. Repeated messages of a similar length at regular intervals point at collection pauses rather than at load.

  2. Leave the startup flags alone

    Your server already starts with Aikar's flags, which are tuned for exactly this. Replacing them with settings from a random forum post usually makes pauses worse, not better.

  3. Reduce what is in memory

    Pauses scale with how much live data has to be examined. Lower view distance, fewer loaded entities and fewer permanently loaded chunks all shorten them.

  4. Check whether you are simply near the ceiling

    A heap that runs constantly near full collects constantly. /spark heapsummary shows how much headroom is left; if there is almost none, this is the memory case where a larger plan genuinely helps.

How to confirm it worked

The freezes become shorter and less frequent, and the Can't keep up! lines stop clustering at regular intervals.

Worth knowing

A single pause after a heavy operation — a world save, a large paste — is normal and not worth chasing. It is the regular rhythm that indicates a problem.