Quick revision
The short answer
In [12.345s][info][gc] GC(42) Pause Young (Normal) (G1 Evacuation Pause) 812M->214M(1024M) 18.532ms, 12.345s is JVM uptime, info the log level and gc the tag set. GC(42) is the 43rd collection since start, counting from 0, and ties related lines together; Pause Young (Normal) is a stop-the-world young collection, and G1 Evacuation Pause its cause, eden filling up. 812M->214M(1024M) is heap used before and after the pause and the committed heap size, and 18.532ms is how long the pause took; we enable such logs with -Xlog:gc or -Xlog:gc*:file=gc.log:time,uptime,level,tags, the unified logging that replaced the old PrintGCDetails style in JDK 9.
What to remember
In this answer, we took apart a unified G1 log line. The decorations give uptime, level and tag set; GC(42) is the 43rd collection, counting from 0, and links related lines; Pause Young (Normal) is a stop-the-world young collection triggered by eden filling up, the G1 Evacuation Pause cause. 812M->214M(1024M) shows heap used before and after and the committed size, and 18.532ms is the pause length. We enable such logs with -Xlog:gc or a detailed -Xlog:gc* file setup, the unified logging that replaced PrintGCDetails in JDK 9.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
In [12.345s][info][gc] GC(42) Pause Young (Normal) (G1 Evacuation Pause) 812M->214M(1024M) 18.532ms, 12.345s is JVM uptime, info the log level and gc the tag set. GC(42) is the 43rd collection since start, counting from 0, and ties related lines together; Pause Young (Normal) is a stop-the-world young collection, and G1 Evacuation Pause its cause, eden filling up. 812M->214M(1024M) is heap used before and after the pause and the committed heap size, and 18.532ms is how long the pause took; we enable such logs with -Xlog:gc or -Xlog:gc*:file=gc.log:time,uptime,level,tags, the unified logging that replaced the old PrintGCDetails style in JDK 9.
Why this question is asked
GC logs are the most useful single source of information about a JVM's memory behaviour, and they cost almost nothing to keep on. But a log line packs a lot into one row, and people often misread it, for example by taking the committed size for the maximum heap or the GC number for a count starting at 1. Interviewers ask this to see whether we can read logs fluently. In this answer, we will take the line apart piece by piece, see what each part tells us, and then look at how to enable these logs and what the after values reveal over time.
1A Quick Recap of Unified Logging
Since JDK 9, all JVM logging, including GC logging, goes through one system called unified logging, controlled by the -Xlog option. Each message has tags that say what it is about, such as gc, gc+heap or gc+phases, and a level such as info or debug. We choose which tags and levels to see, where to write them, and which decorations to put in front of each line.
Before JDK 9, GC logs used flags such as -XX:+PrintGCDetails and -XX:+PrintGCDateStamps, each collector with its own format. On modern JDKs, PrintGCDetails is only accepted as a deprecated alias for -Xlog:gc*, and several of the old flags, such as PrintGCDateStamps, were removed, so the JVM refuses to start with them. The line in our question is the unified format, which looks the same for all collectors.
2Taking the Line Apart
Here is the line again, with each part labelled.
The first three bracketed parts are decorations, added by unified logging. The default set with -Xlog:gc is uptime, level and tags, which is why our line has those three. We can add others, such as wall-clock time, which is useful for matching GC events to request logs.
3The GC Id and Why It Matters
GC(42) is a counter that starts at 0, so this is the 43rd collection since the JVM started. Its main use is tying lines together. With detailed logging, one collection produces many lines, for example phases, heap region counts and worker times, and all of them carry the same GC(42). Concurrent cycles also carry an id, so the concurrent marking lines and its remark and cleanup pauses share one number.
So when we search for a slow pause, we find its GC id and then grep for that id to see every detail of that collection.
4The Pause Type and Its Cause
Pause Young means a young collection, which in G1 stops the application while it evacuates eden and survivor regions. The word in the first parentheses is the young collection's type. Normal is a plain young pause. Concurrent Start means this young pause also started concurrent marking. Prepare Mixed is the last young pause before mixed collections, and Mixed means old regions were collected too.
The second parentheses give the cause, what triggered the collection. G1 Evacuation Pause means the usual reason: eden filled up and an allocation could not be satisfied. Other causes we may see are G1 Humongous Allocation, Metadata GC Threshold, GCLocker Initiated GC and System.gc(). A full collection would appear as Pause Full instead of Pause Young.
| Line starts with | Meaning |
|---|---|
| Pause Young (Normal) | ordinary young collection |
| Pause Young (Concurrent Start) | young collection that also starts marking |
| Pause Remark / Pause Cleanup | short pauses of the concurrent cycle |
| Pause Young (Prepare Mixed) | last young-only pause before mixed collections |
| Pause Young (Mixed) | young plus selected old regions |
| Pause Full (...) | whole-heap compaction: investigate |
5The Heap Numbers and the Duration
812M->214M means 812 MB of heap were in use when the pause started and 214 MB after it. The difference, 598 MB, is mostly eden garbage that was freed; the live young objects were copied to survivor or old regions and are included in the 214 MB, along with the old generation.
The number in parentheses, 1024M, is the committed heap: the memory the JVM has currently reserved for the heap from the operating system. It can be smaller than -Xmx, because the JVM grows the heap only as needed, so a 1024M here does not mean the maximum is 1 GB. Finally, 18.532ms is the length of the pause, the time application threads were stopped for this collection.
6Enabling These Logs
For a quick look, -Xlog:gc prints these summary lines to standard output. In production, it is better to write detailed logs to a rotating file.
The asterisk in gc* means every tag set that starts with gc, which includes heap sizes, phases and ages. Adding time puts a wall-clock timestamp on each line, which makes it easy to line up a pause with a slow request in application logs.
7Follow-up questions
What does the after value of successive young GCs tell you about the live set?
The after value includes everything that survived plus the whole old generation, including old objects that are already dead but not yet collected. So it is an upper bound on the live set, not the live set itself. If the after values climb steadily across many young collections, objects are being promoted; if they drop back after mixed collections, those were just old garbage. The best estimate of the live set is the after value following a mixed collection cycle or a full GC. If even that floor keeps rising over hours, the service is retaining more and more data, which may be a leak.
Why might the committed size change between lines?
The JVM can grow and shrink the committed heap within -Xms and -Xmx, depending on GC pressure. Setting -Xms equal to -Xmx fixes it, which is common in containers so that the memory is committed up front and the numbers stay comparable.
Is 18.532 ms the time the application lost?
It is the time application threads were stopped for the pause itself. Threads also take a little time to reach the safepoint before the pause begins, which is not included; safepoint logging with -Xlog:safepoint shows that part.
8Conclusion
In this answer, we took apart a unified G1 log line. The decorations give uptime, level and tag set; GC(42) is the 43rd collection, counting from 0, and links related lines; Pause Young (Normal) is a stop-the-world young collection triggered by eden filling up, the G1 Evacuation Pause cause. 812M->214M(1024M) shows heap used before and after and the committed size, and 18.532ms is the pause length. We enable such logs with -Xlog:gc or a detailed -Xlog:gc* file setup, the unified logging that replaced PrintGCDetails in JDK 9.
Open with
Reading left to right: 12.345s is the JVM uptime when the line was written, info is the log level, and gc is the tag set; those three are the default decorations of unified logging.
Then, if they want more
GC(42) is the collection id. Ids start at zero, so this is the 43rd collection, and every line about this collection, like phases or heap details, carries the same id, so I can grep for it. Pause Young means a stop-the-world young collection, and Normal means a plain one, as opposed to Concurrent Start, Prepare Mixed or Mixed.
G1 Evacuation Pause is the cause: eden filled up and G1 evacuated it. 812M->214M is heap used before and after the pause, so about 600 MB of mostly eden garbage was freed, and 1024M in parentheses is the committed heap, which can be below the maximum. 18.532ms is how long the application was stopped.
To get these lines I use -Xlog:gc for a quick look, or in production -Xlog:gc* to a file with time, uptime, level and tags decorations and rotation. This unified logging replaced the old PrintGCDetails flags in JDK 9.
Over time, I watch the after values: they are an upper bound on the live set, and if the floor keeps rising even after mixed collections, something is retaining data.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 9
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- HotSpot Garbage Collection Tuning Guide, JDK 21
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain every part of this unified GC log line: [12.345s][info][gc] GC(42) Pause Young...": https://scrivio-interview-library.netlify.app/java/garbage-collection/2f88d20ace/