Jay Turner
Jay Turner

Reputation: 1

G1 GC Logs show regions but not detailed byte information

Using Adoptium Temurin Java 11 and G1 GC settings of

-XX:+UseG1GC -XX:+DisableExplicitGC -verbosegc -Xlog:gc*,safepoint=debug:file=${GCFILENAME}:tags,time,uptime,level:filecount=10,filesize=10M -XX:-OmitStackTraceInFastThrow -XX:+PrintClassHistogram

We get output like this (omitting the leading time info on each line):

[info ][safepoint     ] Entering safepoint region: G1CollectForAllocation
[info ][gc,start      ] GC(5342) Pause Young (Prepare Mixed) (G1 Evacuation Pause)
[info ][gc,task       ] GC(5342) Using 4 workers of 4 for evacuation
[info ][gc,phases     ] GC(5342)   Pre Evacuate Collection Set: 0.1ms
[info ][gc,phases     ] GC(5342)   Evacuate Collection Set: 94.8ms
[info ][gc,phases     ] GC(5342)   Post Evacuate Collection Set: 48.9ms
[info ][gc,phases     ] GC(5342)   Other: 2.7ms
[info ][gc,heap       ] GC(5342) Eden regions: 1521->0(50)
[info ][gc,heap       ] GC(5342) Survivor regions: 15->78(192)
[info ][gc,heap       ] GC(5342) Old regions: 442->442
[info ][gc,heap       ] GC(5342) Humongous regions: 214->0
[info ][gc,metaspace  ] GC(5342) Metaspace: 80251K(87856K)->80251K(87856K) NonClass: 72293K(77488K)->72293K(77488K) Class: 7957K(10368K)->7957K(10368K)
[info ][gc            ] GC(5342) Pause Young (Prepare Mixed) (G1 Evacuation Pause) 4382M->1040M(5120M) 146.102ms
[info ][gc,cpu        ] GC(5342) User=0.56s Sys=0.01s Real=0.15s
[info ][safepoint     ] Leaving safepoint region

I was trying to find explanations of each line of output. I found one article from 2016 that mentioned just settings of { -Xloggc:/home/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps } would give output lines including information like:

[Eden: 12.0M(12.0M)->0.0B(14.0M) Survivors: 0.0B->2048.0K Heap: 12.6M(252.0M)->7848.3K(252.0M)]

I've got more sets of lines like:

[info ][safepoint     ] Entering safepoint region: Cleanup
[info ][safepoint     ] Leaving safepoint region
[info ][safepoint     ] Total time for which application th
[debug][safepoint     ] Safepoint synchronization initiated
[info ][safepoint     ] Application time: 1.0001197 seconds

than I can care to see, but I would like more byte handling/reclamation details. And some interpretation of the output (like what does Eden regions: 1521->0(50) mean?).

Does anyone know of options to get byte handling details and documents on interpreting the output lines? Thank you.

I've tried G1 Logging debug level and -verbosegc. I tried trace level and that's WAY too much detail to be able to sift through and archive.

I would like to see more G1 output similar to the Java 8 GC output where I would get:

 par new generation   total 314560K, used 279616K [0x00000000c0000000, 0x00000000d5550000, 0x00000000d5550000)
  eden space 279616K, 100% used [0x00000000c0000000, 0x00000000d1110000, 0x00000000d1110000)
  from space 34944K,   0% used [0x00000000d1110000, 0x00000000d1110000, 0x00000000d3330000)
  to   space 34944K,   0% used [0x00000000d3330000, 0x00000000d3330000, 0x00000000d5550000)
 concurrent mark-sweep generation total 174784K, used 0K [0x00000000d5550000, 0x00000000e0000000, 0x0000000100000000)
 Metaspace       used 17658K, capacity 18464K, committed 18816K, reserved 1067008K
  class space    used 1931K, capacity 2067K, committed 2176K, reserved 1048576K
Desired survivor size 17891328 bytes, new threshold 15 (max 15)
- age   1:   17555944 bytes,   17555944 total
: 279616K->17269K(314560K), 0.0241802 secs] 279616K->17269K(489344K)
Desired survivor size 17891328 bytes, new threshold 15 (max 15)
- age   1:   17555944 bytes,   17555944 total
: 279616K->17269K(314560K), 0.0241802 secs] 279616K->17269K(489344K)

Though I would still like each line of output timestamped.

I'm looking to increase the logging details about how many bytes are used, committed, and retained. And understand the new format since Eden regions: 1521->0(50) I think is "there were 1521 regions, all were reclaimed, so I went to having 50 regions", but I don't know how many bytes were used and reclamimed.

Upvotes: 0

Views: 51

Answers (0)

Related Questions