liveBook · Manning

GC pause

As explained in Troubleshooting Java, Second Edition

Pause time is the duration for which application execution is suspended or constrained during a runtime operation such as garbage collection.

A GC pause is the time application execution is suspended or constrained while the JVM performs a garbage-collection operation. Excessive or recurring pauses can appear as slower requests, latency spikes, freezes, or high CPU usage with little useful work. section 11.1 section 11.4.1

Investigate GC pauses by asking:

  • How long does each collection pause last, and does the pattern recur across many log entries? section 11.4.1
  • How frequently do minor or full collections occur, and do full collections reclaim much memory? section 11.4.1 section 11.5
  • Are stop-the-world phases using available worker threads effectively? section 11.4.4

Reading a pause pattern

A sequence of young pauses lasting 25–27 ms may be normal, but later pauses of 110 ms and 250 ms, followed by full collections lasting 2.567 and 5.321 seconds, indicates a recurring performance problem requiring investigation. Review heap changes, collection frequency, memory pressure, and worker usage before tuning. section 11.4.1

[GC pause (G1 Evacuation Pause) (young), 0.0456780 secs]
   [Parallel Time: 43.5 ms, GC Workers: 8]
   [Code Root Fixup: 0.0 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CSet: 0.5 ms]

Use the GC log fragment to connect total pause duration with parallel work, worker count, and individual collection phases. section 11.4.1

How Troubleshooting Java, Second Edition covers it

How deep it goes
Explains log-based duration and frequency checks, stop-the-world events, heap reclamation, and worker tuning, but not collector internals in depth.
Examples
Uses G1 evacuation-pause logs, young and full collection sequences, heap-region changes, and worker-count examples.
What it assumes
Assumes familiarity with running Java applications and basic JVM memory terminology while defining GC behavior and log signals directly.
What you can do after
Diagnose recurring pauses with GC logs and evaluate whether memory pressure, heap sizing, leaks, or GC parallelism require investigation.
How it connects
Connects garbage collection with GC logs, stop-the-world events, heap utilization, memory leaks, memory pressure, and GC parallelism.

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.