GC Doctor Analyze garbage collection logs in your browser Analyze your GC log in GC Doctor

Français

Pause / Stop-the-world

A period during which every application thread is halted so that the collector can work on a heap that does not change under its feet.

A period during which every application thread is halted so that the collector can work on a heap that does not change under its feet.

Pauses are what users feel as latency: a request that arrives during a pause waits for the whole pause. A log line such as Pause Young (Normal) (G1 Evacuation Pause) 24M to 4M (256M) 3.2ms gives the cause, the heap before and after the collection, the committed heap size and the duration.

Not all collection work is a pause. Modern collectors (G1, ZGC, Shenandoah) do most of the marking concurrently and keep the stop-the-world phases short, but some work always needs one: starting and ending a marking cycle, evacuating live objects in G1, or a fallback full collection. The length of a pause grows with the amount of live data to copy or scan, not with the amount of garbage; ZGC and Shenandoah are the exception, their pauses are almost independent of the heap size.

GC Doctor charts every pause over time and reports the longest one, the 99th percentile and the share of time spent paused.

Official documentation: JEP 271: Unified GC Logging

Latency

What the GC costs a request: the pauses it adds to response time, notably in the tail.

Averages hide the problem. A collector with a 1 ms average pause can still produce a 500 ms pause once a minute, and that is what the 99th percentile of client latency shows. Look at the maximum pause and the 99th percentile pause, then at how often long pauses occur. Cumulative effects matter as well: several pauses in the same request add up.

The pause reported in the GC log is a lower bound of the stall seen by the application, because the time to reach a safepoint and the time to resume threads are outside it.

Pause / Stop-the-world