Explicit GC (System.gc())
A collection requested by code or by a tool instead of by the collector itself, with the cause System.gc() or Diagnostic Command.
A collection requested by code or by a tool instead of by the collector itself, with the cause System.gc() or Diagnostic Command.
System.gc(), Runtime.gc() and some libraries (NIO direct buffer cleanup, RMI distributed GC, which runs every hour by default) trigger a full collection, shown as Pause Full (System.gc()). Heap inspection tools such as jmap -histo:live and jcmd GC.run also trigger one. Explicit collections are stop-the-world and can last seconds on a large heap.
They are rarely useful. -XX:+DisableExplicitGC ignores them; with G1 or CMS, -XX:+ExplicitGCInvokesConcurrent turns them into concurrent cycles. Pauses that recur at fixed intervals, one hour apart, usually come from RMI.
Official documentation: The java command (Oracle)
Full GC
A stop-the-world collection of the entire heap: mark, then compact. The slowest collection; in a healthy application it is rare or absent.
Typical triggers: no room to promote or allocate after a young collection (Allocation Failure), an explicit System.gc() call, the metaspace threshold, a heap inspection or heap dump request, a concurrent collector that fell behind. The cost grows with the live data, since all of it must be marked and moved: seconds on a multi-gigabyte heap.
Serial and Parallel collect their old generation with a full collection by design. G1 uses a parallel full collection since JDK 10, but it remains a last resort. The sign of a problem is frequent full collections that reclaim little: the live data set is close to the heap size, and the application either leaks memory or is under-provisioned. Read the cause in the log line, Pause Full (cause), then the heap after the collection. GC Doctor lists every full GC with its cause and its heap before and after.
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.
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
Explicit GC (System.gc())