SlideShare a Scribd company logo
1 of 43
Download to read offline
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Let’s Learn to Talk to GC
Logs in Java 9
Poonam Bajaj Parhar
Consulting Member of Technical Staff
JVM Sustaining, Oracle
March 22, 2017
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
New GC Logging in Java 9
5
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
Unified JVM Logging
Unified GC Logging
-Xlog:gc
Old GC Flags
Examples
1
2
3
4
5
6
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
Unified JVM Logging
Unified GC Logging
-Xlog:gc
Old GC Flags
Examples
1
2
3
4
5
7
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Unified JVM Logging
• JEP 158: Unified JVM Logging
– http://openjdk.java.net/jeps/158
• Common command line option for logging from all sub-systems:
-Xlog
• Logging messages categorized using tags
– gc, class, jfr, modules, os, thread etc.
– Messages can have multiple tags (tag-set)
• All logging follows standard and defined levels
– error, warning, info, debug, trace, develop
• Messages can be "decorated". The default decorations are: uptime, level, tags.
• Possible to redirect logging to file
8
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Unified JVM Logging
java -Xlog:help
-Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]]
where 'what' is a combination of tags and levels on the form
tag1[+tag2...][*][=level][,...]
Unless wildcard (*) is specified, only log messages tagged with exactly the
tags specified will be matched.
9
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 10
-Xlog[:option]
option := [<what>][:[<output>][:[<decorators>][:<output-options>]]]
'help'
'disable'
what := <selector>[,...]
selector := <tag-set>[*][=<level>]
tag-set := <tag>[+...]
'all'
tag := name of tag
level := trace
debug
info
warning
error
output := 'stderr'
'stdout'
[file=]<filename>
decorators := <decorator>[,...]
'none'
decorator := time
uptime
timemillis
uptimemillis
timenanos
uptimenanos
pid
tid
level
tags
output-options := <output_option>[,...]
output-option := filecount=<file count>
filesize=<file size in kb>
parameter=value
-Xlog
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
Unified JVM Logging
Unified GC Logging
-Xlog:gc
Old GC Flags
Examples
1
2
3
4
5
11
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Unified GC Logging
• JEP 271: Unified GC Logging
– http://openjdk.java.net/jeps/271
• -Xlog:gc
• Old GC logging options removed
• JDK-8145092: Use Unified Logging for the GC logging
12
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
Unified JVM Logging
Unified GC Logging
-Xlog:gc
Old GC Flags
Examples
1
2
3
4
5
13
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14
bash-3.2$ java -Xlog:gc=trace -jar GCBasher.jar -time:30000
[0.041s][trace][gc] MarkStackSize: 4096k MarkStackSizeMax: 16384k
[0.136s][debug][gc] ConcGCThreads: 6
[0.136s][debug][gc] ParallelGCThreads: 23
[0.138s][debug][gc] Initialize mark stack with 4096 chunks, maximum 16384
[0.230s][info ][gc] Using G1
[3.461s][info ][gc] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 370.917ms
[3.760s][info ][gc] GC(1) Pause Young (G1 Evacuation Pause) 14M->7M(256M) 50.613ms
[4.056s][info ][gc] GC(2) Pause Young (G1 Evacuation Pause) 17M->10M(256M) 42.711ms
[4.438s][info ][gc] GC(3) Pause Young (G1 Evacuation Pause) 20M->12M(256M) 48.097ms
[4.868s][info ][gc] GC(4) Pause Young (G1 Evacuation Pause) 23M->14M(512M) 138.394ms
[5.862s][info ][gc] GC(5) Pause Young (G1 Evacuation Pause) 37M->19M(512M) 128.830ms
[6.444s][info ][gc] GC(6) Pause Young (G1 Evacuation Pause) 40M->24M(512M) 83.761ms
[6.964s][info ][gc] GC(7) Pause Young (G1 Evacuation Pause) 45M->28M(512M) 82.317ms
[7.639s][info ][gc] GC(8) Pause Young (G1 Evacuation Pause) 49M->33M(1025M) 264.165ms
[10.877s][info ][gc] GC(9) Pause Young (G1 Evacuation Pause) 80M->42M(1025M) 140.376ms
[11.996s][info ][gc] GC(10) Pause Young (G1 Evacuation Pause) 88M->51M(1025M) 156.818ms
[12.997s][info ][gc] GC(11) Pause Young (G1 Evacuation Pause) 95M->59M(1025M) 128.167ms
[14.224s][info ][gc] GC(12) Pause Young (G1 Evacuation Pause) 103M->69M(1812M) 432.548ms
[17.484s][info ][gc] GC(13) Pause Young (G1 Evacuation Pause) 154M->87M(1812M) 249.748ms
[19.387s][info ][gc] GC(14) Pause Young (G1 Evacuation Pause) 165M->103M(1812M) 244.751ms
[21.352s][info ][gc] GC(15) Pause Young (G1 Evacuation Pause) 181M->117M(1812M) 214.431ms
[23.913s][info ][gc] GC(16) Pause Young (G1 Evacuation Pause) 197M->136M(2396M) 465.712ms
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
Unified JVM Logging
Unified GC Logging
-Xlog:gc
Old GC Flags
Examples
1
2
3
4
5
15
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Popular GC Logging Flags
• -XX:+PrintGC
• -XX:+PrintGCDetails
• -Xloggc
• Mapped to corresponding –Xlog configurations
• Deprecated
16
Old New
-XX:+PrintGC -Xlog:gc
-XX:+PrintGCDetails -Xlog:gc*
-Xloggc:<filename> -Xlog:gc:<filename>
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 17
CMSDumpAtPromotionFailure, CMSPrintEdenSurvivorChunks, G1LogLevel,
G1PrintHeapRegions, G1PrintRegionLivenessInfo, G1SummarizeConcMark,
G1SummarizeRSetStats, G1TraceConcRefinement,
G1TraceEagerReclaimHumongousObjects, G1TraceStringSymbolTableScrubbing,
GCLogFileSize, NumberOfGCLogFiles, PrintAdaptiveSizePolicy,
PrintClassHistogramAfterFullGC, PrintClassHistogramBeforeFullGC,
PrintCMSInitiationStatistics, PrintCMSStatistics, PrintFLSCensus,
PrintFLSStatistics, PrintGCApplicationConcurrentTime,
PrintGCApplicationStoppedTime, PrintGCCause, PrintGCDateStamps, PrintGCID,
PrintGCTaskTimeStamps, PrintGCTimeStamps, PrintHeapAtGC,
PrintHeapAtGCExtended, PrintJNIGCStalls, PrintOldPLAB,
PrintParallelOldGCPhaseTimes, PrintPLAB, PrintPromotionFailure,
PrintReferenceGC, PrintStringDeduplicationStatistics, PrintTaskqueue,
PrintTenuringDistribution, PrintTerminationStats, PrintTLAB,
TraceDynamicGCThreads, TraceMetadataHumongousAllocation, UseGCLogFileRotation,
VerifySilently
43 GC Logging Flags Removed
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 18
-void GenCollectedHeap::print_heap_change(size_t prev_used) const {
- if (PrintGCDetails && Verbose) {
- gclog_or_tty->print(" " SIZE_FORMAT
- "->" SIZE_FORMAT
- "(" SIZE_FORMAT ")",
- prev_used, used(), capacity());
- } else {
- gclog_or_tty->print(" " SIZE_FORMAT "K"
- "->" SIZE_FORMAT "K"
- "(" SIZE_FORMAT "K)",
- prev_used / K, used() / K, capacity() / K);
- }
+void GenCollectedHeap::print_heap_change(size_t young_prev_used, size_t old_prev_used) const {
+ log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)",
+ _young_gen->short_name(), young_prev_used / K, _young_gen->used() /K,
+ _young_gen->capacity() /K);
+ log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)",
+ _old_gen->short_name(), old_prev_used / K, _old_gen->used() /K,
+ _old_gen->capacity() /K);
+ }
GC Logging code change
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 19
- if (PrintAdaptiveSizePolicy) {
- ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
- gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: "
- "collection: %d "
- "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> "
- "(" SIZE_FORMAT ", " SIZE_FORMAT ") ",
- heap->total_collections(),
- old_from, old_to,
- from_space()->capacity_in_bytes(),
- to_space()->capacity_in_bytes());
- gclog_or_tty->cr();
- }
+ log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: "
+ "collection: %d "
+ "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> "
+ "(" SIZE_FORMAT ", " SIZE_FORMAT ") ",
+ ParallelScavengeHeap::heap()->total_collections(),
+ old_from, old_to,
+ from_space()->capacity_in_bytes(),
+ to_space()->capacity_in_bytes());
+
GC Logging code change
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Agenda
Unified JVM Logging
Unified GC Logging
-Xlog:gc
Old GC Flags
Examples
1
2
3
4
5
20
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 21
bash-3.2$ java -XX:+UseG1GC -XX:+PrintGC GCTest
[GC pause (G1 Evacuation Pause) (young) 24M->4527K(256M), 0.0861751 secs]
[GC pause (G1 Evacuation Pause) (young) 20M->9270K(256M), 0.0630344 secs]
[GC pause (G1 Evacuation Pause) (young) 35M->16M(256M), 0.0797056 secs]
[GC pause (G1 Evacuation Pause) (young) 53M->26M(256M), 0.0793465 secs]
[GC pause (G1 Evacuation Pause) (young) 69M->40M(256M), 0.0800461 secs]
[GC pause (G1 Evacuation Pause) (young) 91M->56M(256M), 0.0977231 secs]
[GC pause (G1 Evacuation Pause) (young) 113M->74M(256M), 0.0993368 secs]
[GC pause (G1 Evacuation Pause) (young) 146M->100M(256M), 0.0960482 secs]
[GC pause (G1 Evacuation Pause) (young) 184M->123M(256M), 0.1460180 secs]
[GC pause (G1 Evacuation Pause) (young) 206M->146M(256M), 0.1060365 secs]
[GC pause (G1 Evacuation Pause) (young) (initial-mark) 213M->168M(256M), 0.0964933 secs]
[GC concurrent-root-region-scan-start]
[GC concurrent-root-region-scan-end, 0.0372045 secs]
[GC concurrent-mark-start]
[GC concurrent-mark-end, 0.1160973 secs]
[GC remark, 0.0143419 secs]
[GC cleanup 176M->88M(256M), 0.0049707 secs]
[GC concurrent-cleanup-start]
[GC concurrent-cleanup-end, 0.0010084 secs]
[GC pause (G1 Evacuation Pause) (young) 131M->98M(256M), 0.0967931 secs]
[GC pause (G1 Evacuation Pause) (mixed) 102M->78M(256M), 0.0414904 secs]
[GC pause (G1 Evacuation Pause) (mixed) 88M->72M(256M), 0.0424158 secs]
[GC pause (G1 Evacuation Pause) (young) 201M->101M(256M), 0.1429243 secs]
[…]
-XX:+PrintGC
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22
bash-3.2$ java -Xlog:gc GCTest
[0.222s][info][gc] Using G1
[2.825s][info][gc] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 355.623ms
[3.096s][info][gc] GC(1) Pause Young (G1 Evacuation Pause) 14M->7M(256M) 50.030ms
[3.385s][info][gc] GC(2) Pause Young (G1 Evacuation Pause) 17M->10M(256M) 40.576ms
[3.722s][info][gc] GC(3) Pause Young (G1 Evacuation Pause) 20M->12M(256M) 44.238ms
[4.146s][info][gc] GC(4) Pause Young (G1 Evacuation Pause) 24M->14M(512M) 129.102ms
[4.911s][info][gc] GC(5) Pause Young (G1 Evacuation Pause) 37M->19M(512M) 116.106ms
[5.387s][info][gc] GC(6) Pause Young (G1 Evacuation Pause) 40M->24M(512M) 77.929ms
[5.852s][info][gc] GC(7) Pause Young (G1 Evacuation Pause) 45M->28M(512M) 79.247ms
[6.458s][info][gc] GC(8) Pause Young (G1 Evacuation Pause) 49M->33M(1073M) 259.616ms
[9.584s][info][gc] GC(9) Pause Young (G1 Evacuation Pause) 83M->44M(1073M) 132.574ms
[10.602s][info][gc] GC(10) Pause Young (G1 Evacuation Pause) 91M->51M(1073M) 147.744ms
[11.566s][info][gc] GC(11) Pause Young (G1 Evacuation Pause) 97M->61M(1073M) 127.917ms
[12.748s][info][gc] GC(12) Pause Young (G1 Evacuation Pause) 107M->71M(1924M) 423.438ms
[15.766s][info][gc] GC(13) Pause Young (G1 Evacuation Pause) 162M->89M(1924M) 249.404ms
[17.484s][info][gc] GC(14) Pause Young (G1 Evacuation Pause) 173M->107M(1924M) 252.302ms
[…]
-Xlog:gc
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 23
bash-3.2$ java -XX:+UseG1GC -XX:+PrintGCDetails GCTest
[GC pause (G1 Evacuation Pause) (young), 0.0858830 secs]
[Parallel Time: 73.2 ms, GC Workers: 23]
[GC Worker Start (ms): Min: 2141.5, Avg: 2141.9, Max: 2142.3, Diff: 0.8]
[Ext Root Scanning (ms): Min: 0.4, Avg: 1.3, Max: 17.6, Diff: 17.2, Sum: 31.0]
[Update RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
[Processed Buffers: Min: 0, Avg: 0.0, Max: 0, Diff: 0, Sum: 0]
[Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.4]
[Code Root Scanning (ms): Min: 0.0, Avg: 0.3, Max: 4.4, Diff: 4.4, Sum: 7.1]
[Object Copy (ms): Min: 52.2, Avg: 67.6, Max: 69.9, Diff: 17.7, Sum: 1555.0]
[Termination (ms): Min: 0.0, Avg: 1.1, Max: 2.3, Diff: 2.3, Sum: 26.0]
[Termination Attempts: Min: 1, Avg: 5.3, Max: 10, Diff: 9, Sum: 123]
[GC Worker Other (ms): Min: 1.2, Avg: 1.6, Max: 2.0, Diff: 0.8, Sum: 36.6]
[GC Worker Total (ms): Min: 71.6, Avg: 72.0, Max: 72.4, Diff: 0.9, Sum: 1656.3]
[GC Worker End (ms): Min: 2213.9, Avg: 2213.9, Max: 2214.0, Diff: 0.2]
[Code Root Fixup: 1.2 ms]
[Code Root Purge: 0.1 ms]
[Clear CT: 1.2 ms]
[Other: 10.3 ms]
[Choose CSet: 0.1 ms]
[Ref Proc: 5.1 ms]
[Ref Enq: 0.1 ms]
[Redirty Cards: 1.1 ms]
[Humongous Register: 1.0 ms]
[Humongous Reclaim: 0.0 ms]
[Free CSet: 0.5 ms]
[Eden: 24.0M(24.0M)->0.0B(16.0M) Survivors: 0.0B->3072.0K Heap: 24.0M(256.0M)->4529.0K(256.0M)]
[Times: user=0.46 sys=0.92, real=0.09 secs]
-XX:+PrintGCDetails
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 24
bash-3.2$ java -Xlog:gc* GCTest
[0.233s][info][gc,heap] Heap region size: 1M
[0.383s][info][gc ] Using G1
[0.383s][info][gc,heap,coops] Heap address: 0xfffffffe50400000, size: 4064 MB, Compressed Oops mode: Non-zero based:
0xfffffffe50000000, Oop shift amount: 3
[3.064s][info][gc,start ] GC(0) Pause Young (G1 Evacuation Pause)
[3.064s][info][gc,task ] GC(0) Using 23 workers of 23 for evacuation
[3.420s][info][gc,phases ] GC(0) Pre Evacuate Collection Set: 0.2ms
[3.421s][info][gc,phases ] GC(0) Evacuate Collection Set: 348.0ms
[3.421s][info][gc,phases ] GC(0) Post Evacuate Collection Set: 6.2ms
[3.421s][info][gc,phases ] GC(0) Other: 2.8ms
[3.421s][info][gc,heap ] GC(0) Eden regions: 24->0(9)
[3.421s][info][gc,heap ] GC(0) Survivor regions: 0->3(3)
[3.421s][info][gc,heap ] GC(0) Old regions: 0->2
[3.421s][info][gc,heap ] GC(0) Humongous regions: 2->1
[3.421s][info][gc,metaspace ] GC(0) Metaspace: 4719K->4719K(1056768K)
[3.421s][info][gc ] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 357.743ms
[3.422s][info][gc,cpu ] GC(0) User=0.70s Sys=5.13s Real=0.36s
[3.648s][info][gc,start ] GC(1) Pause Young (G1 Evacuation Pause)
[3.648s][info][gc,task ] GC(1) Using 23 workers of 23 for evacuation
[3.699s][info][gc,phases ] GC(1) Pre Evacuate Collection Set: 0.3ms
[3.699s][info][gc,phases ] GC(1) Evacuate Collection Set: 45.6ms
[3.699s][info][gc,phases ] GC(1) Post Evacuate Collection Set: 3.4ms
[3.699s][info][gc,phases ] GC(1) Other: 1.7ms
[3.699s][info][gc,heap ] GC(1) Eden regions: 9->0(10)
[3.699s][info][gc,heap ] GC(1) Survivor regions: 3->2(2)
[3.699s][info][gc,heap ] GC(1) Old regions: 2->5
[3.700s][info][gc,heap ] GC(1) Humongous regions: 1->1
[3.700s][info][gc,metaspace ] GC(1) Metaspace: 4726K->4726K(1056768K)
[3.700s][info][gc ] GC(1) Pause Young (G1 Evacuation Pause) 14M->7M(256M) 51.872ms
[3.700s][info][gc,cpu ] GC(1) User=0.56s Sys=0.46s Real=0.05s
[…]
-Xlog:gc*
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 25
bash-3.2$ java -Xlog:gc*,gc+phases=debug GCTest [0.115s][info][gc,heap] Heap region size: 1M
[0.227s][info][gc ] Using G1
[0.227s][info][gc,heap,coops] Heap address: 0xfffffffe50400000, size: 4064 MB, Compressed Oops mode: Non-zero based: 0xfffffffe50000000, Oop shift amount: 3
[2.448s][info][gc,start ] GC(0) Pause Young (G1 Evacuation Pause)
[2.448s][info][gc,task ] GC(0) Using 23 workers of 23 for evacuation
[2.796s][info][gc,phases ] GC(0) Pre Evacuate Collection Set: 0.2ms
[2.797s][debug][gc,phases ] GC(0) Choose Collection Set: 0.0ms
[2.797s][debug][gc,phases ] GC(0) Humongous Register: 0.1ms
[2.797s][info ][gc,phases ] GC(0) Evacuate Collection Set: 341.6ms
[2.797s][debug][gc,phases ] GC(0) Ext Root Scanning (ms): Min: 0.0, Avg: 9.2, Max: 205.8, Diff: 205.8, Sum: 212.0, Workers: 23
[2.797s][debug][gc,phases ] GC(0) Update RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1, Workers: 23
[2.797s][debug][gc,phases ] GC(0) Processed Buffers: Min: 0, Avg: 0.0, Max: 0, Diff: 0, Sum: 0, Workers: 23
[2.797s][debug][gc,phases ] GC(0) Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.2, Workers: 23
[2.797s][debug][gc,phases ] GC(0) Code Root Scanning (ms): Min: 0.0, Avg: 0.8, Max: 4.6, Diff: 4.6, Sum: 17.7, Workers: 23
[2.797s][debug][gc,phases ] GC(0) Object Copy (ms): Min: 135.2, Avg: 330.2, Max: 340.7, Diff: 205.6, Sum: 7594.1, Workers: 23
[2.797s][debug][gc,phases ] GC(0) Termination (ms): Min: 0.0, Avg: 0.8, Max: 1.6, Diff: 1.5, Sum: 18.7, Workers: 23
[2.798s][debug][gc,phases ] GC(0) Termination Attempts: Min: 1, Avg: 4.0, Max: 8, Diff: 7, Sum: 91, Workers: 23
[2.798s][debug][gc,phases ] GC(0) GC Worker Other (ms): Min: 0.0, Avg: 0.1, Max: 0.2, Diff: 0.1, Sum: 1.2, Workers: 23
[2.798s][debug][gc,phases ] GC(0) GC Worker Total (ms): Min: 340.6, Avg: 341.0, Max: 341.5, Diff: 0.8, Sum: 7844.1, Workers: 23
[2.798s][info ][gc,phases ] GC(0) Post Evacuate Collection Set: 4.7ms
[2.798s][debug][gc,phases ] GC(0) Code Roots Fixup: 0.0ms
[2.798s][debug][gc,phases ] GC(0) Preserve CM Refs: 0.0ms
[2.798s][debug][gc,phases ] GC(0) Reference Processing: 3.1ms
[2.798s][debug][gc,phases ] GC(0) Clear Card Table: 0.1ms
[2.798s][debug][gc,phases ] GC(0) Reference Enqueuing: 0.1ms
[2.798s][debug][gc,phases ] GC(0) Merge Per-Thread State: 0.2ms
[2.798s][debug][gc,phases ] GC(0) Code Roots Purge: 0.1ms
[2.798s][debug][gc,phases ] GC(0) Redirty Cards: 0.3ms
[2.798s][debug][gc,phases ] GC(0) Free Collection Set: 0.6ms
[2.798s][debug][gc,phases ] GC(0) Humongous Reclaim: 0.1ms
[2.799s][debug][gc,phases ] GC(0) Expand Heap After Collection: 0.0ms
[2.799s][info ][gc,phases ] GC(0) Other: 1.9ms
[2.799s][info ][gc,heap ] GC(0) Eden regions: 24->0(9)
[2.799s][info ][gc,heap ] GC(0) Survivor regions: 0->3(3)
[2.799s][info ][gc,heap ] GC(0) Old regions: 0->2
[2.799s][info ][gc,heap ] GC(0) Humongous regions: 2->1
[2.799s][info ][gc,metaspace ] GC(0) Metaspace: 4719K->4719K(1056768K)
[2.799s][info ][gc ] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 350.839ms
[2.799s][info ][gc,cpu ] GC(0) User=0.61s Sys=5.00s Real=0.35s
[…]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 26
{Heap before GC invocations=0 (full 0):
garbage-first heap total 262144K, used 24576K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000)
region size 1024K, 24 young (24576K), 0 survivors (0K)
Metaspace used 2835K, capacity 4596K, committed 4864K, reserved 1056768K
class space used 301K, capacity 424K, committed 512K, reserved 1048576K
Heap after GC invocations=1 (full 0):
garbage-first heap total 262144K, used 4525K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000)
region size 1024K, 3 young (3072K), 3 survivors (3072K)
Metaspace used 2835K, capacity 4596K, committed 4864K, reserved 1056768K
class space used 301K, capacity 424K, committed 512K, reserved 1048576K
}
{Heap before GC invocations=1 (full 0):
garbage-first heap total 262144K, used 19885K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000)
region size 1024K, 18 young (18432K), 3 survivors (3072K)
Metaspace used 2843K, capacity 4596K, committed 4864K, reserved 1056768K
class space used 301K, capacity 424K, committed 512K, reserved 1048576K
Heap after GC invocations=2 (full 0):
garbage-first heap total 262144K, used 9072K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000)
region size 1024K, 3 young (3072K), 3 survivors (3072K)
Metaspace used 2843K, capacity 4596K, committed 4864K, reserved 1056768K
class space used 301K, capacity 424K, committed 512K, reserved 1048576K
}
-XX:+PrintHeapAtGC
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 27
bash-3.2$ java -Xlog:gc+heap=debug GCTest
[0.113s][info][gc,heap] Heap region size: 1M
[0.113s][debug][gc,heap] Minimum heap 8388608 Initial heap 268435456 Maximum heap 4261412864
[2.529s][debug][gc,heap] GC(0) Heap before GC invocations=0 (full 0):
[2.529s][debug][gc,heap] GC(0) garbage-first heap total 262144K, used 26624K [0xfffffffe50400000, 0xfffffffe50500800,
0xffffffff4e400000)
[2.529s][debug][gc,heap] GC(0) region size 1024K, 24 young (24576K), 0 survivors (0K)
[2.530s][debug][gc,heap] GC(0) Metaspace used 4719K, capacity 4844K, committed 5120K, reserved 1056768K
[2.530s][debug][gc,heap] GC(0) class space used 413K, capacity 464K, committed 512K, reserved 1048576K
[2.892s][info ][gc,heap] GC(0) Eden regions: 24->0(9)
[2.892s][info ][gc,heap] GC(0) Survivor regions: 0->3(3)
[2.892s][info ][gc,heap] GC(0) Old regions: 0->2
[2.892s][info ][gc,heap] GC(0) Humongous regions: 2->1
[2.893s][debug][gc,heap] GC(0) Heap after GC invocations=1 (full 0):
[2.893s][debug][gc,heap] GC(0) garbage-first heap total 262144K, used 5850K [0xfffffffe50400000, 0xfffffffe50500800,
0xffffffff4e400000)
[2.893s][debug][gc,heap] GC(0) region size 1024K, 3 young (3072K), 3 survivors (3072K)
[2.893s][debug][gc,heap] GC(0) Metaspace used 4719K, capacity 4844K, committed 5120K, reserved 1056768K
[2.893s][debug][gc,heap] GC(0) class space used 413K, capacity 464K, committed 512K, reserved 1048576K
[3.107s][debug][gc,heap] GC(1) Heap before GC invocations=1 (full 0):
[3.107s][debug][gc,heap] GC(1) garbage-first heap total 262144K, used 15066K [0xfffffffe50400000, 0xfffffffe50500800,
0xffffffff4e400000)
[3.108s][debug][gc,heap] GC(1) region size 1024K, 12 young (12288K), 3 survivors (3072K)
[3.108s][debug][gc,heap] GC(1) Metaspace used 4726K, capacity 4844K, committed 5120K, reserved 1056768K
[3.108s][debug][gc,heap] GC(1) class space used 413K, capacity 464K, committed 512K, reserved 1048576K
[3.158s][info ][gc,heap] GC(1) Eden regions: 9->0(10)
[3.158s][info ][gc,heap] GC(1) Survivor regions: 3->2(2)
[…]
-Xlog:gc+heap=debug
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 28
bash-3.2$ java -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+UseG1GC GCTest
Application time: 0.6692265 seconds
Total time for which application threads were stopped: 0.0006422 seconds, Stopping threads took: 0.0003064 seconds
Application time: 0.6252223 seconds
Total time for which application threads were stopped: 0.0847633 seconds, Stopping threads took: 0.0002372 seconds
Application time: 0.3719981 seconds
Total time for which application threads were stopped: 0.0607710 seconds, Stopping threads took: 0.0002263 seconds
Application time: 0.6516762 seconds
Total time for which application threads were stopped: 0.0802199 seconds, Stopping threads took: 0.0004294 seconds
Application time: 0.7976582 seconds
Total time for which application threads were stopped: 0.0741299 seconds, Stopping threads took: 0.0002259 seconds
Application time: 0.6417216 seconds
Total time for which application threads were stopped: 0.0006499 seconds, Stopping threads took: 0.0002845 seconds
Application time: 0.1142872 seconds
Total time for which application threads were stopped: 0.0851334 seconds, Stopping threads took: 0.0002213 seconds
Application time: 0.2681632 seconds
Total time for which application threads were stopped: 0.0004676 seconds, Stopping threads took: 0.0002502 seconds
Application time: 0.0046448 seconds
Total time for which application threads were stopped: 0.0003611 seconds, Stopping threads took: 0.0001791 seconds
[…]
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCApplicationStoppedTime
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 29
bash-3.2$ java -Xlog:safepoint GCTest
[1.376s][info][safepoint] Application time: 0.3091519 seconds
[1.377s][info][safepoint] Total time for which application threads were stopped: 0.0004600 seconds, Stopping threads took:
0.0002648 seconds
[2.386s][info][safepoint] Application time: 1.0091637 seconds
[2.387s][info][safepoint] Total time for which application threads were stopped: 0.0005217 seconds, Stopping threads took:
0.0002297 seconds
[2.430s][info][safepoint] Application time: 0.0423349 seconds
[2.784s][info][safepoint] Total time for which application threads were stopped: 0.3548135 seconds, Stopping threads took:
0.0002130 seconds
[2.992s][info][safepoint] Application time: 0.2072894 seconds
[3.040s][info][safepoint] Total time for which application threads were stopped: 0.0475234 seconds, Stopping threads took:
0.0002285 seconds
[3.294s][info][safepoint] Application time: 0.2541180 seconds
[3.333s][info][safepoint] Total time for which application threads were stopped: 0.0388724 seconds, Stopping threads took:
0.0002681 seconds
[3.617s][info][safepoint] Application time: 0.2836815 seconds
[3.661s][info][safepoint] Total time for which application threads were stopped: 0.0440203 seconds, Stopping threads took:
0.0002210 seconds
[3.957s][info][safepoint] Application time: 0.2964698 seconds
[4.089s][info][safepoint] Total time for which application threads were stopped: 0.1313429 seconds, Stopping threads took:
0.0002244 seconds
[4.717s][info][safepoint] Application time: 0.6276530 seconds
[4.827s][info][safepoint] Total time for which application threads were stopped: 0.1104660 seconds, Stopping threads took:
0.0002243 seconds
[…]
-Xlog:safepoint
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 30
bash-3.2$ java -XX:+PrintAdaptiveSizePolicy -XX:+UseG1GC GCTest
0.323: [G1Ergonomics (Heap Sizing) expand the heap, requested expansion amount: 268435456 bytes, attempted expansion
amount: 268435456 bytes]
2.544: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 0, predicted base time: 10.00 ms, remaining
time: 190.00 ms, target pause time: 200.00 ms]
2.544: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 24 regions, survivors: 0 regions, predicted
young region time: 367.19 ms]
2.545: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 24 regions, survivors: 0 regions, old: 0 regions,
predicted pause time: 377.19 ms, target pause time: 200.00 ms]
3.013: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 6159, predicted base time: 33.53 ms,
remaining time: 166.47 ms, target pause time: 200.00 ms]
3.013: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 16 regions, survivors: 3 regions, predicted
young region time: 189.82 ms]
3.013: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 16 regions, survivors: 3 regions, old: 0 regions,
predicted pause time: 223.35 ms, target pause time: 200.00 ms]
3.723: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 6657, predicted base time: 27.44 ms,
remaining time: 172.56 ms, target pause time: 200.00 ms]
3.723: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 26 regions, survivors: 3 regions, predicted
young region time: 188.88 ms]
3.723: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 26 regions, survivors: 3 regions, old: 0 regions,
predicted pause time: 216.32 ms, target pause time: 200.00 ms]
[…]
-XX:+PrintAdaptiveSizePolicy
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 31
bash-3.2$ java -Xlog:gc+ergo*=trace GCTest [0.122s][debug][gc,ergo,refine] Initial Refinement Zones: green: 23, yellow:
69, red: 115, min yellow size: 46
[0.142s][debug][gc,ergo,heap ] Expand the heap. requested expansion amount:268435456B expansion amount:268435456B
[2.475s][trace][gc,ergo,cset ] GC(0) Start choosing CSet. pending cards: 0 predicted base time: 10.00ms remaining time:
190.00ms target pause time: 200.00ms
[2.476s][trace][gc,ergo,cset ] GC(0) Add young regions to CSet. eden: 24 regions, survivors: 0 regions, predicted young
region time: 367.19ms, target pause time: 200.00ms
[2.476s][debug][gc,ergo,cset ] GC(0) Finish choosing CSet. old: 0 regions, predicted old region time: 0.00ms, time
remaining: 0.00
[2.826s][debug][gc,ergo ] GC(0) Running G1 Clear Card Table Task using 1 workers for 1 units of work for 24 regions.
[2.827s][debug][gc,ergo ] GC(0) Running G1 Free Collection Set using 1 workers for collection set length 24
[2.828s][trace][gc,ergo,refine] GC(0) Updating Refinement Zones: update_rs time: 0.004ms, update_rs buffers: 0, update_rs
goal time: 19.999ms
[2.829s][debug][gc,ergo,refine] GC(0) Updated Refinement Zones: green: 23, yellow: 69, red: 115
[3.045s][trace][gc,ergo,cset ] GC(1) Start choosing CSet. pending cards: 5898 predicted base time: 26.69ms remaining
time: 173.31ms target pause time: 200.00ms
[3.045s][trace][gc,ergo,cset ] GC(1) Add young regions to CSet. eden: 9 regions, survivors: 3 regions, predicted young
region time: 457.38ms, target pause time: 200.00ms
[3.045s][debug][gc,ergo,cset ] GC(1) Finish choosing CSet. old: 0 regions, predicted old region time: 0.00ms, time
remaining: 0.00
[3.090s][debug][gc,ergo ] GC(1) Running G1 Clear Card Table Task using 1 workers for 1 units of work for 12 regions.
[3.091s][debug][gc,ergo ] GC(1) Running G1 Free Collection Set using 1 workers for collection set length 12
[3.093s][trace][gc,ergo,refine] GC(1) Updating Refinement Zones: update_rs time: 2.510ms, update_rs buffers: 25, update_rs
goal time: 19.999ms
[3.093s][debug][gc,ergo,refine] GC(1) Updated Refinement Zones: green: 25, yellow: 75, red: 125
[…]
-Xlog:gc+ergo*=trace
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 32
bash-3.2$ java -XX:+PrintTenuringDistribution -XX:MaxTenuringThreshold=15 -XX:+UseG1GC
GCTest
Desired survivor size 1048576 bytes, new threshold 15 (max 15)
- age 1: 143280 bytes, 143280 total
Desired survivor size 9961472 bytes, new threshold 15 (max 15)
- age 1: 1679496 bytes, 1679496 total
- age 2: 115912 bytes, 1795408 total
Desired survivor size 8912896 bytes, new threshold 1 (max 15)
- age 1: 17444896 bytes, 17444896 total
- age 2: 787568 bytes, 18232464 total
- age 3: 89512 bytes, 18321976 total
Desired survivor size 7340032 bytes, new threshold 1 (max 15)
- age 1: 17357168 bytes, 17357168 total
-XX:+PrintTenuringDistribution
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 33
bash-3.2$ java -Xlog:gc+age=trace GCTest
[2.406s][debug][gc,age] GC(0) Desired survivor size 1572864 bytes, new threshold 15 (max threshold 15)
[2.745s][trace][gc,age] GC(0) Age table with threshold 15 (max threshold 15)
[2.745s][trace][gc,age] GC(0) - age 1: 3100640 bytes, 3100640 total
[2.964s][debug][gc,age] GC(1) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15)
[3.011s][trace][gc,age] GC(1) Age table with threshold 1 (max threshold 15)
[3.011s][trace][gc,age] GC(1) - age 1: 1928480 bytes, 1928480 total
[3.267s][debug][gc,age] GC(2) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15)
[3.304s][trace][gc,age] GC(2) Age table with threshold 1 (max threshold 15)
[3.304s][trace][gc,age] GC(2) - age 1: 1985736 bytes, 1985736 total
[3.600s][debug][gc,age] GC(3) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15)
[3.641s][trace][gc,age] GC(3) Age table with threshold 1 (max threshold 15)
[3.641s][trace][gc,age] GC(3) - age 1: 2005984 bytes, 2005984 total
[3.937s][debug][gc,age] GC(4) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15)
[3.981s][trace][gc,age] GC(4) Age table with threshold 1 (max threshold 15)
[3.982s][trace][gc,age] GC(4) - age 1: 2076584 bytes, 2076584 total
[4.700s][debug][gc,age] GC(5) Desired survivor size 2097152 bytes, new threshold 15 (max threshold 15)
[4.810s][trace][gc,age] GC(5) Age table with threshold 15 (max threshold 15)
[4.810s][trace][gc,age] GC(5) - age 1: 2658280 bytes, 2658280 total
[4.810s][trace][gc,age] GC(5) - age 2: 1527360 bytes, 4185640 total
[5.205s][debug][gc,age] GC(6) Desired survivor size 2097152 bytes, new threshold 1 (max threshold 15)
[…]
-Xlog:gc+age=trace
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
-Xloggc:<file>, UseGCLogFileRotation,
NumberOfGCLogFiles, GCLogFileSize
• bash-3.2$ java -Xloggc:gc.old.log -XX:+UseGCLogFileRotation -
XX:NumberOfGCLogFiles=3 -XX:+UseG1GC GCTest
• Log files
– gc.old.log.0
– gc.old.log.1
– gc.old.log.2.current
34
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
-Xlog:gc*:file=<file>::filecount=<count>,filesize=<filesize in
kb>
• bash-3.2$ java -Xlog:gc*:file=gc.new.log::filecount=3,filesize=1024 GCTest
• Log Files:
– gc.new.log
– gc.new.log.1
– gc.new.log.0
– gc.new.log.2
35
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Other Useful Tags
• -Xlog:gc*=trace (all of gc logging at the lowest level)
• -Xlog:all=trace (all the JVM logging at the lowest level)
• -Xlog:disable (disable all logging)
• -Xlog:help (syntax and examples)
• -Xlog:logging=trace (logging for the logging framework)
36
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 37
bash-3.2$ java -Xlog:logging=trace GCTest
[0.604s][info][logging] Log configuration fully initialized.
[0.604s][debug][logging] Available log levels: off, trace, debug, info, warning, error
[0.604s][debug][logging] Available log decorators: time (t), utctime (utc), uptime (u),
timemillis (tm), uptimemillis (um), timenanos (tn), uptimenanos (un), hostname (hn), pid (p)
, tid (ti), level (l), tags (tg)
[0.604s][debug][logging] Available log tags: add, age, alloc, aot, annotation, arguments,
attach, barrier, biasedlocking, blocks, bot, breakpoint, census, class, classhisto, cleanu
p, compaction, constraints, constantpool, coops, cpu, cset, data, defaultmethods, dump, ergo,
exceptions, exit, fingerprint, freelist, gc, hashtables, heap, humongous, ihop, iklass
, init, itables, jni, jvmti, liveness, load, loader, logging, mark, marking, methodcomparator,
metadata, metaspace, mmu, modules, monitorinflation, monitormismatch, nmethod, normal
ize, objecttagging, obsolete, oopmap, os, pagesize, patch, path, phases, plab, promotion,
preorder, protectiondomain, ref, redefine, refine, region, remset, purge, resolve, safepoi
nt, scavenge, scrub, stacktrace, stackwalk, start, startuptime, state, stats, stringdedup,
stringtable, stackmap, subclass, survivor, sweep, task, thread, tlab, time, timer, update
, unload, verification, verify, vmoperation, vtables, workgang, jfr, system, parser, bytecode,
setting, event
[0.604s][debug][logging] Described tag combinations:
[0.604s][debug][logging] logging: Logging for the log framework itself
[0.605s][debug][logging] Log output configuration:
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 38
[0.605s][debug][logging] #0: stdout
os+cpu=warning,vmoperation=warning,verification=warning,ref=warning,modules+startuptime=warnin
g,monitorinflation=warning,stackwalk=warning,safepoint+cleanup=warning,gc+ref+start=warning,gc
+ref=warning,ergo=warning,gc+compaction=warning,os+thread=warning,safepoint=warning,pagesize=w
arning,os=warning,redefine+class+oopmap=warning,redefine+class+nmethod=warning,modules+patch=w
arning,redefine+class+methodcomparator=warning,startuptime=warning,gc+metaspace+freelist+block
s=warning,gc+metaspace+alloc=warning,gc+metaspace=warning,gc+metaspace+freelist=warning,class+
loader+constraints=warning,vtables=warning,itables=warning,redefine+class+update+itables=warni
ng,redefine+class+obsolete+metadata=warning,redefine+class+timer=warning,redefine+class+normal
ize=warning,redefine+class+load=warning,redefine+class+load+exceptions=warning,redefine+class+
constantpool=warning,redefine+class+annotation=warning,redefine+class+stackmap=warning,redefin
e+class+obsolete+mark=warning,redefine+class+subclass=warning,redefine+class=warning,redefine+
class+dump=warning,redefine+class+breakpoint=warning,jvmti+objecttagging=warning,jvmti=warning
,jfr+system+event=warning,jfr+system+setting=warning,jfr+system+bytecode=warning,jfr+system+pa
rser=warning,jfr+system+metadata=warning,jfr+metadata=warning,jfr+event=warning,jfr+setting=wa
rning,jfr=warning,jfr+system=warning,stacktrace=warning,gc+heap+exit=warning,redefine+class+ob
solete=warning,class+init=warning,modules=warning,redefine+class+update+vtables=warning,redefi
ne+class+iklass+purge=warning,redefine+class+iklass+add=warning,monitormismatch=warning,gc+cpu
=warning,gc+task+thread=warning,gc+task+time=warning,gc+jni=warning,gc+stringdedup=warning,gc+
marking+start=warning,gc+remset=warning,gc+remset+exit=warning,gc+verify+start=warning,gc+ihop
=warning,gc+phases+task=warning,gc+stats=warning,gc+ergo+cset=warning,gc+stringtable=warning,g
c+heap+region=warning,gc+task+stats=warning,gc+humongous=warning,gc+region=warning,protectiond
omain=warning,gc+ergo+ihop=warning,gc+scavenge=warning,gc+mmu=warning,defaultmethods=warning,g
c+ergo+heap=warning,redefine+class+update=warning
[…]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 39
bash-3.2$ jcmd 29688 VM.log
29688:
Syntax : VM.log [options]
Options: (options must be specified using the <key> or <key>=<value> syntax)
output : [optional] The name or index (#<index>) of output to configure.
(STRING, no default value)
output_options : [optional] Options for the output. (STRING, no default value)
what : [optional] Configures what tags to log. (STRING, no default value)
decorators : [optional] Configures which decorators to use. Use 'none' or an
empty value to remove all. (STRING, no default value)
disable : [optional] Turns off all logging and clears the log configuration.
(BOOLEAN, no default value)
list : [optional] Lists current log configuration. (BOOLEAN, no default value)
rotate : [optional] Rotates all logs. (BOOLEAN, no default value)
bash-3.2$ jcmd 29688 VM.log what=gc*
4460:
Command executed successfully
Runtime Configuration of -Xlog
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 40
Old GC logging option Equivalent –Xlog:gc configuration
G1PrintHeapRegions -Xlog:gc+region=trace
G1PrintRegionLivenessInfo -Xlog:gc+liveness=trace
G1SummarizeConcMark -Xlog:gc+marking=trace
G1SummarizeRSetStats -Xlog:gc+remset*=trace
GCLogFileSize, NumberOfGCLogFiles,
UseGCLogFileRotation
-Xlog:gc*:file=<file>::filecount=<count>,filesize=<filesize
in kb>
PrintAdaptiveSizePolicy -Xlog:gc+ergo*=trace
PrintClassHistogramAfterFullGC -Xlog:classhisto*=trace
PrintClassHistogramBeforeFullGC -Xlog:classhisto*=trace
PrintGCApplicationConcurrentTime -Xlog:safepoint
PrintGCApplicationStoppedTime -Xlog:safepoint
PrintGCCause Always logged
PrintGCDateStamps ‘time’ decorator
PrintGCID Always logged
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 41
Old GC logging option Equivalent –Xlog:gc configuration
PrintGCTaskTimeStamps -Xlog:gc+task=trace
PrintGCTimeStamps ‘uptime’ decorator
PrintHeapAtGC -Xlog:gc+heap=debug
PrintHeapAtGCExtended -Xlog:gc+heap=trace
PrintJNIGCStalls -Xlog:gc+jni=debug
PrintOldPLAB -Xlog:gc+plab=trace
PrintParallelOldGCPhaseTimes -Xlog:gc+phases=trace
PrintPLAB -Xlog:gc+plab=trace
PrintPromotionFailure -Xlog:gc+promotion=debug
PrintReferenceGC -Xlog:gc+ref=debug
PrintStringDeduplicationStatistics -Xlog:gc+stringdedup
PrintTaskqueue -Xlog:gc+task+stats=trace
PrintTenuringDistribution -Xlog:gc+age=trace
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 42
Old GC logging option Equivalent –Xlog:gc configuration
PrintTerminationStats -Xlog:gc+task+stats=debug
PrintTLAB -Xlog:gc+tlab=trace
TraceAdaptiveGCBoundary -Xlog:heap+ergo=debug
TraceDynamicGCThreads -Xlog:gc+task=trace
TraceMetadataHumongousAllocation -Xlog:gc+metaspace+alloc=debug
G1TraceConcRefinement -Xlog:gc+refine=debug
G1TraceEagerReclaimHumongousObjects -Xlog:gc+humongous=debug
G1TraceStringSymbolTableScrubbing -Xlog:gc+stringtable=trace
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 43

More Related Content

What's hot

ClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei MilovidovClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei MilovidovAltinity Ltd
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detailMIJIN AN
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Advanced Postgres Monitoring
Advanced Postgres MonitoringAdvanced Postgres Monitoring
Advanced Postgres MonitoringDenish Patel
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman scriptMaris Elsins
 
The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...
The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...
The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...DataStax
 
High Availability for Oracle SE2
High Availability for Oracle SE2High Availability for Oracle SE2
High Availability for Oracle SE2Markus Flechtner
 
The top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scaleThe top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scaleFlink Forward
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재PgDay.Seoul
 
オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)
オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)
オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningPuneet Behl
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsConnor McDonald
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 
Stephan Ewen - Experiences running Flink at Very Large Scale
Stephan Ewen -  Experiences running Flink at Very Large ScaleStephan Ewen -  Experiences running Flink at Very Large Scale
Stephan Ewen - Experiences running Flink at Very Large ScaleVerverica
 
Evening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkEvening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkFlink Forward
 
PostgreSQL運用管理入門
PostgreSQL運用管理入門PostgreSQL運用管理入門
PostgreSQL運用管理入門Yoshiyuki Asaba
 
Adventures with the ClickHouse ReplacingMergeTree Engine
Adventures with the ClickHouse ReplacingMergeTree EngineAdventures with the ClickHouse ReplacingMergeTree Engine
Adventures with the ClickHouse ReplacingMergeTree EngineAltinity Ltd
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation
 
PostgreSQL - C言語によるユーザ定義関数の作り方
PostgreSQL - C言語によるユーザ定義関数の作り方PostgreSQL - C言語によるユーザ定義関数の作り方
PostgreSQL - C言語によるユーザ定義関数の作り方Satoshi Nagayasu
 
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...NoSQLmatters
 

What's hot (20)

ClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei MilovidovClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei Milovidov
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detail
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Advanced Postgres Monitoring
Advanced Postgres MonitoringAdvanced Postgres Monitoring
Advanced Postgres Monitoring
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman script
 
The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...
The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...
The Missing Manual for Leveled Compaction Strategy (Wei Deng & Ryan Svihla, D...
 
High Availability for Oracle SE2
High Availability for Oracle SE2High Availability for Oracle SE2
High Availability for Oracle SE2
 
The top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scaleThe top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scale
 
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
[pgday.Seoul 2022] PostgreSQL구조 - 윤성재
 
オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)
オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)
オンライン物理バックアップの排他モードと非排他モードについて(第15回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tips
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
Stephan Ewen - Experiences running Flink at Very Large Scale
Stephan Ewen -  Experiences running Flink at Very Large ScaleStephan Ewen -  Experiences running Flink at Very Large Scale
Stephan Ewen - Experiences running Flink at Very Large Scale
 
Evening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkEvening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in Flink
 
PostgreSQL運用管理入門
PostgreSQL運用管理入門PostgreSQL運用管理入門
PostgreSQL運用管理入門
 
Adventures with the ClickHouse ReplacingMergeTree Engine
Adventures with the ClickHouse ReplacingMergeTree EngineAdventures with the ClickHouse ReplacingMergeTree Engine
Adventures with the ClickHouse ReplacingMergeTree Engine
 
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
PostgreSQLのfull_page_writesについて(第24回PostgreSQLアンカンファレンス@オンライン 発表資料)
 
PostgreSQL - C言語によるユーザ定義関数の作り方
PostgreSQL - C言語によるユーザ定義関数の作り方PostgreSQL - C言語によるユーザ定義関数の作り方
PostgreSQL - C言語によるユーザ定義関数の作り方
 
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...
 

Viewers also liked

Spring Framework Essentials
Spring Framework EssentialsSpring Framework Essentials
Spring Framework EssentialsEdward Goikhman
 
мифы о спарке
мифы о спарке мифы о спарке
мифы о спарке Evgeny Borisov
 
Java GC - Pause tuning
Java GC - Pause tuningJava GC - Pause tuning
Java GC - Pause tuningekino
 
Java gc
Java gcJava gc
Java gcNiit
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Anna Shymchenko
 
Java Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyJava Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyDhanu Gupta
 
Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"Ciklum Minsk
 
Java Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextJava Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextTomek Borek
 
New Threats, New Approaches in Modern Data Centers
New Threats, New Approaches in Modern Data CentersNew Threats, New Approaches in Modern Data Centers
New Threats, New Approaches in Modern Data CentersIben Rodriguez
 
Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimizationRajan Jethva
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GCKelum Senanayake
 

Viewers also liked (20)

Spring Framework Essentials
Spring Framework EssentialsSpring Framework Essentials
Spring Framework Essentials
 
Como construir-tu-vivienda
Como construir-tu-viviendaComo construir-tu-vivienda
Como construir-tu-vivienda
 
Spock
SpockSpock
Spock
 
мифы о спарке
мифы о спарке мифы о спарке
мифы о спарке
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
Java GC - Pause tuning
Java GC - Pause tuningJava GC - Pause tuning
Java GC - Pause tuning
 
Java gc
Java gcJava gc
Java gc
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Java Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyJava Garbage Collection(GC)- Study
Java Garbage Collection(GC)- Study
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Spring data jee conf
Spring data jee confSpring data jee conf
Spring data jee conf
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"Николай Папирный Тема: "Java memory model для простых смертных"
Николай Папирный Тема: "Java memory model для простых смертных"
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Java Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextJava Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and context
 
Troubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VMTroubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VM
 
New Threats, New Approaches in Modern Data Centers
New Threats, New Approaches in Modern Data CentersNew Threats, New Approaches in Modern Data Centers
New Threats, New Approaches in Modern Data Centers
 
Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimization
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
 

Similar to Let's Learn to Talk to GC Logs in Java 9

Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringCary Millsap
 
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013Gregg Donovan
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsPoonam Bajaj Parhar
 
18(ish) Things You'll Love About Oracle Database 18c
18(ish) Things You'll Love About Oracle Database 18c18(ish) Things You'll Love About Oracle Database 18c
18(ish) Things You'll Love About Oracle Database 18cChris Saxon
 
JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...
JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...
JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...Juan Cruz Nores
 
Become a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsBecome a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsTier1app
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasualYuji Kubota
 
ORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricksORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricksDmytro Istratkin
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterpriseInfluxData
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTPMustafa TURAN
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinChad Cooper
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesBobby Curtis
 

Similar to Let's Learn to Talk to GC Logs in Java 9 (20)

Living with garbage
Living with garbageLiving with garbage
Living with garbage
 
Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and Monitoring
 
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
Living with Garbage by Gregg Donovan at LuceneSolr Revolution 2013
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
 
18(ish) Things You'll Love About Oracle Database 18c
18(ish) Things You'll Love About Oracle Database 18c18(ish) Things You'll Love About Oracle Database 18c
18(ish) Things You'll Love About Oracle Database 18c
 
Living With Garbage
Living With GarbageLiving With Garbage
Living With Garbage
 
Groovy
GroovyGroovy
Groovy
 
JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...
JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...
JavaOne 2016: Code Generation with JavaCompiler for Fun, Speed and Business P...
 
Become a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsBecome a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day Devops
 
Why Grails?
Why Grails?Why Grails?
Why Grails?
 
Why Grails
Why GrailsWhy Grails
Why Grails
 
jcmd #javacasual
jcmd #javacasualjcmd #javacasual
jcmd #javacasual
 
ORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricksORM in Go. Internals, tips & tricks
ORM in Go. Internals, tips & tricks
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
 
Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 
Tuning the g1gc
Tuning the g1gcTuning the g1gc
Tuning the g1gc
 
Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And Pythonwin
 
Le guide de dépannage de la jvm
Le guide de dépannage de la jvmLe guide de dépannage de la jvm
Le guide de dépannage de la jvm
 
R console
R consoleR console
R console
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 

Recently uploaded

The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Business Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business AnalysisBusiness Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business AnalysisDEEPRAJ PATHAK
 
logical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxlogical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxRemote DBA Services
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...
Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...
Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...Milind Agarwal
 
SPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptx
SPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptxSPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptx
SPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptxVersion 1 Analytics
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...
Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...
Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...OnePlan Solutions
 
Chapter -5 Agile Testing types and its examples.pptx
Chapter -5 Agile Testing types and its examples.pptxChapter -5 Agile Testing types and its examples.pptx
Chapter -5 Agile Testing types and its examples.pptxManishaPatil932723
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfkalichargn70th171
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
full course of software engineering mid term.pdf
full course of software engineering mid term.pdffull course of software engineering mid term.pdf
full course of software engineering mid term.pdfAbdul salam
 
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...Piyovi
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxRTS corp
 
What is Mendix and the concept of low-code development.docx
What is Mendix and the concept of low-code development.docxWhat is Mendix and the concept of low-code development.docx
What is Mendix and the concept of low-code development.docxTechnogeeks
 

Recently uploaded (20)

The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Business Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business AnalysisBusiness Analyzopedia - Your Pocket Gita for Business Analysis
Business Analyzopedia - Your Pocket Gita for Business Analysis
 
logical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptxlogical backup of Oracle Datapump-detailed.pptx
logical backup of Oracle Datapump-detailed.pptx
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...
Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...
Leveraging the Expertise of a Social Media Fraud Analyst to Safeguard Brand R...
 
SPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptx
SPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptxSPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptx
SPSS Statistics - Encrypting a Syntax File in IBM SPSS Statistics.pptx
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...
Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...
Transform your Corporate Strategy Office - Harness OnePlan’s Strategic Portfo...
 
Chapter -5 Agile Testing types and its examples.pptx
Chapter -5 Agile Testing types and its examples.pptxChapter -5 Agile Testing types and its examples.pptx
Chapter -5 Agile Testing types and its examples.pptx
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
full course of software engineering mid term.pdf
full course of software engineering mid term.pdffull course of software engineering mid term.pdf
full course of software engineering mid term.pdf
 
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptx
 
What is Mendix and the concept of low-code development.docx
What is Mendix and the concept of low-code development.docxWhat is Mendix and the concept of low-code development.docx
What is Mendix and the concept of low-code development.docx
 

Let's Learn to Talk to GC Logs in Java 9

  • 1.
  • 2.
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Let’s Learn to Talk to GC Logs in Java 9 Poonam Bajaj Parhar Consulting Member of Technical Staff JVM Sustaining, Oracle March 22, 2017
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 4
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | New GC Logging in Java 9 5
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda Unified JVM Logging Unified GC Logging -Xlog:gc Old GC Flags Examples 1 2 3 4 5 6
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda Unified JVM Logging Unified GC Logging -Xlog:gc Old GC Flags Examples 1 2 3 4 5 7
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Unified JVM Logging • JEP 158: Unified JVM Logging – http://openjdk.java.net/jeps/158 • Common command line option for logging from all sub-systems: -Xlog • Logging messages categorized using tags – gc, class, jfr, modules, os, thread etc. – Messages can have multiple tags (tag-set) • All logging follows standard and defined levels – error, warning, info, debug, trace, develop • Messages can be "decorated". The default decorations are: uptime, level, tags. • Possible to redirect logging to file 8
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Unified JVM Logging java -Xlog:help -Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]] where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...] Unless wildcard (*) is specified, only log messages tagged with exactly the tags specified will be matched. 9
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 10 -Xlog[:option] option := [<what>][:[<output>][:[<decorators>][:<output-options>]]] 'help' 'disable' what := <selector>[,...] selector := <tag-set>[*][=<level>] tag-set := <tag>[+...] 'all' tag := name of tag level := trace debug info warning error output := 'stderr' 'stdout' [file=]<filename> decorators := <decorator>[,...] 'none' decorator := time uptime timemillis uptimemillis timenanos uptimenanos pid tid level tags output-options := <output_option>[,...] output-option := filecount=<file count> filesize=<file size in kb> parameter=value -Xlog
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda Unified JVM Logging Unified GC Logging -Xlog:gc Old GC Flags Examples 1 2 3 4 5 11
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Unified GC Logging • JEP 271: Unified GC Logging – http://openjdk.java.net/jeps/271 • -Xlog:gc • Old GC logging options removed • JDK-8145092: Use Unified Logging for the GC logging 12
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda Unified JVM Logging Unified GC Logging -Xlog:gc Old GC Flags Examples 1 2 3 4 5 13
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 14 bash-3.2$ java -Xlog:gc=trace -jar GCBasher.jar -time:30000 [0.041s][trace][gc] MarkStackSize: 4096k MarkStackSizeMax: 16384k [0.136s][debug][gc] ConcGCThreads: 6 [0.136s][debug][gc] ParallelGCThreads: 23 [0.138s][debug][gc] Initialize mark stack with 4096 chunks, maximum 16384 [0.230s][info ][gc] Using G1 [3.461s][info ][gc] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 370.917ms [3.760s][info ][gc] GC(1) Pause Young (G1 Evacuation Pause) 14M->7M(256M) 50.613ms [4.056s][info ][gc] GC(2) Pause Young (G1 Evacuation Pause) 17M->10M(256M) 42.711ms [4.438s][info ][gc] GC(3) Pause Young (G1 Evacuation Pause) 20M->12M(256M) 48.097ms [4.868s][info ][gc] GC(4) Pause Young (G1 Evacuation Pause) 23M->14M(512M) 138.394ms [5.862s][info ][gc] GC(5) Pause Young (G1 Evacuation Pause) 37M->19M(512M) 128.830ms [6.444s][info ][gc] GC(6) Pause Young (G1 Evacuation Pause) 40M->24M(512M) 83.761ms [6.964s][info ][gc] GC(7) Pause Young (G1 Evacuation Pause) 45M->28M(512M) 82.317ms [7.639s][info ][gc] GC(8) Pause Young (G1 Evacuation Pause) 49M->33M(1025M) 264.165ms [10.877s][info ][gc] GC(9) Pause Young (G1 Evacuation Pause) 80M->42M(1025M) 140.376ms [11.996s][info ][gc] GC(10) Pause Young (G1 Evacuation Pause) 88M->51M(1025M) 156.818ms [12.997s][info ][gc] GC(11) Pause Young (G1 Evacuation Pause) 95M->59M(1025M) 128.167ms [14.224s][info ][gc] GC(12) Pause Young (G1 Evacuation Pause) 103M->69M(1812M) 432.548ms [17.484s][info ][gc] GC(13) Pause Young (G1 Evacuation Pause) 154M->87M(1812M) 249.748ms [19.387s][info ][gc] GC(14) Pause Young (G1 Evacuation Pause) 165M->103M(1812M) 244.751ms [21.352s][info ][gc] GC(15) Pause Young (G1 Evacuation Pause) 181M->117M(1812M) 214.431ms [23.913s][info ][gc] GC(16) Pause Young (G1 Evacuation Pause) 197M->136M(2396M) 465.712ms
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda Unified JVM Logging Unified GC Logging -Xlog:gc Old GC Flags Examples 1 2 3 4 5 15
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Popular GC Logging Flags • -XX:+PrintGC • -XX:+PrintGCDetails • -Xloggc • Mapped to corresponding –Xlog configurations • Deprecated 16 Old New -XX:+PrintGC -Xlog:gc -XX:+PrintGCDetails -Xlog:gc* -Xloggc:<filename> -Xlog:gc:<filename>
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 17 CMSDumpAtPromotionFailure, CMSPrintEdenSurvivorChunks, G1LogLevel, G1PrintHeapRegions, G1PrintRegionLivenessInfo, G1SummarizeConcMark, G1SummarizeRSetStats, G1TraceConcRefinement, G1TraceEagerReclaimHumongousObjects, G1TraceStringSymbolTableScrubbing, GCLogFileSize, NumberOfGCLogFiles, PrintAdaptiveSizePolicy, PrintClassHistogramAfterFullGC, PrintClassHistogramBeforeFullGC, PrintCMSInitiationStatistics, PrintCMSStatistics, PrintFLSCensus, PrintFLSStatistics, PrintGCApplicationConcurrentTime, PrintGCApplicationStoppedTime, PrintGCCause, PrintGCDateStamps, PrintGCID, PrintGCTaskTimeStamps, PrintGCTimeStamps, PrintHeapAtGC, PrintHeapAtGCExtended, PrintJNIGCStalls, PrintOldPLAB, PrintParallelOldGCPhaseTimes, PrintPLAB, PrintPromotionFailure, PrintReferenceGC, PrintStringDeduplicationStatistics, PrintTaskqueue, PrintTenuringDistribution, PrintTerminationStats, PrintTLAB, TraceDynamicGCThreads, TraceMetadataHumongousAllocation, UseGCLogFileRotation, VerifySilently 43 GC Logging Flags Removed
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 18 -void GenCollectedHeap::print_heap_change(size_t prev_used) const { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } +void GenCollectedHeap::print_heap_change(size_t young_prev_used, size_t old_prev_used) const { + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _young_gen->short_name(), young_prev_used / K, _young_gen->used() /K, + _young_gen->capacity() /K); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _old_gen->short_name(), old_prev_used / K, _old_gen->used() /K, + _old_gen->capacity() /K); + } GC Logging code change
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 19 - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " - "collection: %d " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", - heap->total_collections(), - old_from, old_to, - from_space()->capacity_in_bytes(), - to_space()->capacity_in_bytes()); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: " + "collection: %d " + "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " + "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + old_from, old_to, + from_space()->capacity_in_bytes(), + to_space()->capacity_in_bytes()); + GC Logging code change
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Agenda Unified JVM Logging Unified GC Logging -Xlog:gc Old GC Flags Examples 1 2 3 4 5 20
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 21 bash-3.2$ java -XX:+UseG1GC -XX:+PrintGC GCTest [GC pause (G1 Evacuation Pause) (young) 24M->4527K(256M), 0.0861751 secs] [GC pause (G1 Evacuation Pause) (young) 20M->9270K(256M), 0.0630344 secs] [GC pause (G1 Evacuation Pause) (young) 35M->16M(256M), 0.0797056 secs] [GC pause (G1 Evacuation Pause) (young) 53M->26M(256M), 0.0793465 secs] [GC pause (G1 Evacuation Pause) (young) 69M->40M(256M), 0.0800461 secs] [GC pause (G1 Evacuation Pause) (young) 91M->56M(256M), 0.0977231 secs] [GC pause (G1 Evacuation Pause) (young) 113M->74M(256M), 0.0993368 secs] [GC pause (G1 Evacuation Pause) (young) 146M->100M(256M), 0.0960482 secs] [GC pause (G1 Evacuation Pause) (young) 184M->123M(256M), 0.1460180 secs] [GC pause (G1 Evacuation Pause) (young) 206M->146M(256M), 0.1060365 secs] [GC pause (G1 Evacuation Pause) (young) (initial-mark) 213M->168M(256M), 0.0964933 secs] [GC concurrent-root-region-scan-start] [GC concurrent-root-region-scan-end, 0.0372045 secs] [GC concurrent-mark-start] [GC concurrent-mark-end, 0.1160973 secs] [GC remark, 0.0143419 secs] [GC cleanup 176M->88M(256M), 0.0049707 secs] [GC concurrent-cleanup-start] [GC concurrent-cleanup-end, 0.0010084 secs] [GC pause (G1 Evacuation Pause) (young) 131M->98M(256M), 0.0967931 secs] [GC pause (G1 Evacuation Pause) (mixed) 102M->78M(256M), 0.0414904 secs] [GC pause (G1 Evacuation Pause) (mixed) 88M->72M(256M), 0.0424158 secs] [GC pause (G1 Evacuation Pause) (young) 201M->101M(256M), 0.1429243 secs] […] -XX:+PrintGC
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22 bash-3.2$ java -Xlog:gc GCTest [0.222s][info][gc] Using G1 [2.825s][info][gc] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 355.623ms [3.096s][info][gc] GC(1) Pause Young (G1 Evacuation Pause) 14M->7M(256M) 50.030ms [3.385s][info][gc] GC(2) Pause Young (G1 Evacuation Pause) 17M->10M(256M) 40.576ms [3.722s][info][gc] GC(3) Pause Young (G1 Evacuation Pause) 20M->12M(256M) 44.238ms [4.146s][info][gc] GC(4) Pause Young (G1 Evacuation Pause) 24M->14M(512M) 129.102ms [4.911s][info][gc] GC(5) Pause Young (G1 Evacuation Pause) 37M->19M(512M) 116.106ms [5.387s][info][gc] GC(6) Pause Young (G1 Evacuation Pause) 40M->24M(512M) 77.929ms [5.852s][info][gc] GC(7) Pause Young (G1 Evacuation Pause) 45M->28M(512M) 79.247ms [6.458s][info][gc] GC(8) Pause Young (G1 Evacuation Pause) 49M->33M(1073M) 259.616ms [9.584s][info][gc] GC(9) Pause Young (G1 Evacuation Pause) 83M->44M(1073M) 132.574ms [10.602s][info][gc] GC(10) Pause Young (G1 Evacuation Pause) 91M->51M(1073M) 147.744ms [11.566s][info][gc] GC(11) Pause Young (G1 Evacuation Pause) 97M->61M(1073M) 127.917ms [12.748s][info][gc] GC(12) Pause Young (G1 Evacuation Pause) 107M->71M(1924M) 423.438ms [15.766s][info][gc] GC(13) Pause Young (G1 Evacuation Pause) 162M->89M(1924M) 249.404ms [17.484s][info][gc] GC(14) Pause Young (G1 Evacuation Pause) 173M->107M(1924M) 252.302ms […] -Xlog:gc
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 23 bash-3.2$ java -XX:+UseG1GC -XX:+PrintGCDetails GCTest [GC pause (G1 Evacuation Pause) (young), 0.0858830 secs] [Parallel Time: 73.2 ms, GC Workers: 23] [GC Worker Start (ms): Min: 2141.5, Avg: 2141.9, Max: 2142.3, Diff: 0.8] [Ext Root Scanning (ms): Min: 0.4, Avg: 1.3, Max: 17.6, Diff: 17.2, Sum: 31.0] [Update RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1] [Processed Buffers: Min: 0, Avg: 0.0, Max: 0, Diff: 0, Sum: 0] [Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.4] [Code Root Scanning (ms): Min: 0.0, Avg: 0.3, Max: 4.4, Diff: 4.4, Sum: 7.1] [Object Copy (ms): Min: 52.2, Avg: 67.6, Max: 69.9, Diff: 17.7, Sum: 1555.0] [Termination (ms): Min: 0.0, Avg: 1.1, Max: 2.3, Diff: 2.3, Sum: 26.0] [Termination Attempts: Min: 1, Avg: 5.3, Max: 10, Diff: 9, Sum: 123] [GC Worker Other (ms): Min: 1.2, Avg: 1.6, Max: 2.0, Diff: 0.8, Sum: 36.6] [GC Worker Total (ms): Min: 71.6, Avg: 72.0, Max: 72.4, Diff: 0.9, Sum: 1656.3] [GC Worker End (ms): Min: 2213.9, Avg: 2213.9, Max: 2214.0, Diff: 0.2] [Code Root Fixup: 1.2 ms] [Code Root Purge: 0.1 ms] [Clear CT: 1.2 ms] [Other: 10.3 ms] [Choose CSet: 0.1 ms] [Ref Proc: 5.1 ms] [Ref Enq: 0.1 ms] [Redirty Cards: 1.1 ms] [Humongous Register: 1.0 ms] [Humongous Reclaim: 0.0 ms] [Free CSet: 0.5 ms] [Eden: 24.0M(24.0M)->0.0B(16.0M) Survivors: 0.0B->3072.0K Heap: 24.0M(256.0M)->4529.0K(256.0M)] [Times: user=0.46 sys=0.92, real=0.09 secs] -XX:+PrintGCDetails
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 24 bash-3.2$ java -Xlog:gc* GCTest [0.233s][info][gc,heap] Heap region size: 1M [0.383s][info][gc ] Using G1 [0.383s][info][gc,heap,coops] Heap address: 0xfffffffe50400000, size: 4064 MB, Compressed Oops mode: Non-zero based: 0xfffffffe50000000, Oop shift amount: 3 [3.064s][info][gc,start ] GC(0) Pause Young (G1 Evacuation Pause) [3.064s][info][gc,task ] GC(0) Using 23 workers of 23 for evacuation [3.420s][info][gc,phases ] GC(0) Pre Evacuate Collection Set: 0.2ms [3.421s][info][gc,phases ] GC(0) Evacuate Collection Set: 348.0ms [3.421s][info][gc,phases ] GC(0) Post Evacuate Collection Set: 6.2ms [3.421s][info][gc,phases ] GC(0) Other: 2.8ms [3.421s][info][gc,heap ] GC(0) Eden regions: 24->0(9) [3.421s][info][gc,heap ] GC(0) Survivor regions: 0->3(3) [3.421s][info][gc,heap ] GC(0) Old regions: 0->2 [3.421s][info][gc,heap ] GC(0) Humongous regions: 2->1 [3.421s][info][gc,metaspace ] GC(0) Metaspace: 4719K->4719K(1056768K) [3.421s][info][gc ] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 357.743ms [3.422s][info][gc,cpu ] GC(0) User=0.70s Sys=5.13s Real=0.36s [3.648s][info][gc,start ] GC(1) Pause Young (G1 Evacuation Pause) [3.648s][info][gc,task ] GC(1) Using 23 workers of 23 for evacuation [3.699s][info][gc,phases ] GC(1) Pre Evacuate Collection Set: 0.3ms [3.699s][info][gc,phases ] GC(1) Evacuate Collection Set: 45.6ms [3.699s][info][gc,phases ] GC(1) Post Evacuate Collection Set: 3.4ms [3.699s][info][gc,phases ] GC(1) Other: 1.7ms [3.699s][info][gc,heap ] GC(1) Eden regions: 9->0(10) [3.699s][info][gc,heap ] GC(1) Survivor regions: 3->2(2) [3.699s][info][gc,heap ] GC(1) Old regions: 2->5 [3.700s][info][gc,heap ] GC(1) Humongous regions: 1->1 [3.700s][info][gc,metaspace ] GC(1) Metaspace: 4726K->4726K(1056768K) [3.700s][info][gc ] GC(1) Pause Young (G1 Evacuation Pause) 14M->7M(256M) 51.872ms [3.700s][info][gc,cpu ] GC(1) User=0.56s Sys=0.46s Real=0.05s […] -Xlog:gc*
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 25 bash-3.2$ java -Xlog:gc*,gc+phases=debug GCTest [0.115s][info][gc,heap] Heap region size: 1M [0.227s][info][gc ] Using G1 [0.227s][info][gc,heap,coops] Heap address: 0xfffffffe50400000, size: 4064 MB, Compressed Oops mode: Non-zero based: 0xfffffffe50000000, Oop shift amount: 3 [2.448s][info][gc,start ] GC(0) Pause Young (G1 Evacuation Pause) [2.448s][info][gc,task ] GC(0) Using 23 workers of 23 for evacuation [2.796s][info][gc,phases ] GC(0) Pre Evacuate Collection Set: 0.2ms [2.797s][debug][gc,phases ] GC(0) Choose Collection Set: 0.0ms [2.797s][debug][gc,phases ] GC(0) Humongous Register: 0.1ms [2.797s][info ][gc,phases ] GC(0) Evacuate Collection Set: 341.6ms [2.797s][debug][gc,phases ] GC(0) Ext Root Scanning (ms): Min: 0.0, Avg: 9.2, Max: 205.8, Diff: 205.8, Sum: 212.0, Workers: 23 [2.797s][debug][gc,phases ] GC(0) Update RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1, Workers: 23 [2.797s][debug][gc,phases ] GC(0) Processed Buffers: Min: 0, Avg: 0.0, Max: 0, Diff: 0, Sum: 0, Workers: 23 [2.797s][debug][gc,phases ] GC(0) Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.2, Workers: 23 [2.797s][debug][gc,phases ] GC(0) Code Root Scanning (ms): Min: 0.0, Avg: 0.8, Max: 4.6, Diff: 4.6, Sum: 17.7, Workers: 23 [2.797s][debug][gc,phases ] GC(0) Object Copy (ms): Min: 135.2, Avg: 330.2, Max: 340.7, Diff: 205.6, Sum: 7594.1, Workers: 23 [2.797s][debug][gc,phases ] GC(0) Termination (ms): Min: 0.0, Avg: 0.8, Max: 1.6, Diff: 1.5, Sum: 18.7, Workers: 23 [2.798s][debug][gc,phases ] GC(0) Termination Attempts: Min: 1, Avg: 4.0, Max: 8, Diff: 7, Sum: 91, Workers: 23 [2.798s][debug][gc,phases ] GC(0) GC Worker Other (ms): Min: 0.0, Avg: 0.1, Max: 0.2, Diff: 0.1, Sum: 1.2, Workers: 23 [2.798s][debug][gc,phases ] GC(0) GC Worker Total (ms): Min: 340.6, Avg: 341.0, Max: 341.5, Diff: 0.8, Sum: 7844.1, Workers: 23 [2.798s][info ][gc,phases ] GC(0) Post Evacuate Collection Set: 4.7ms [2.798s][debug][gc,phases ] GC(0) Code Roots Fixup: 0.0ms [2.798s][debug][gc,phases ] GC(0) Preserve CM Refs: 0.0ms [2.798s][debug][gc,phases ] GC(0) Reference Processing: 3.1ms [2.798s][debug][gc,phases ] GC(0) Clear Card Table: 0.1ms [2.798s][debug][gc,phases ] GC(0) Reference Enqueuing: 0.1ms [2.798s][debug][gc,phases ] GC(0) Merge Per-Thread State: 0.2ms [2.798s][debug][gc,phases ] GC(0) Code Roots Purge: 0.1ms [2.798s][debug][gc,phases ] GC(0) Redirty Cards: 0.3ms [2.798s][debug][gc,phases ] GC(0) Free Collection Set: 0.6ms [2.798s][debug][gc,phases ] GC(0) Humongous Reclaim: 0.1ms [2.799s][debug][gc,phases ] GC(0) Expand Heap After Collection: 0.0ms [2.799s][info ][gc,phases ] GC(0) Other: 1.9ms [2.799s][info ][gc,heap ] GC(0) Eden regions: 24->0(9) [2.799s][info ][gc,heap ] GC(0) Survivor regions: 0->3(3) [2.799s][info ][gc,heap ] GC(0) Old regions: 0->2 [2.799s][info ][gc,heap ] GC(0) Humongous regions: 2->1 [2.799s][info ][gc,metaspace ] GC(0) Metaspace: 4719K->4719K(1056768K) [2.799s][info ][gc ] GC(0) Pause Young (G1 Evacuation Pause) 26M->5M(256M) 350.839ms [2.799s][info ][gc,cpu ] GC(0) User=0.61s Sys=5.00s Real=0.35s […]
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 26 {Heap before GC invocations=0 (full 0): garbage-first heap total 262144K, used 24576K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000) region size 1024K, 24 young (24576K), 0 survivors (0K) Metaspace used 2835K, capacity 4596K, committed 4864K, reserved 1056768K class space used 301K, capacity 424K, committed 512K, reserved 1048576K Heap after GC invocations=1 (full 0): garbage-first heap total 262144K, used 4525K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000) region size 1024K, 3 young (3072K), 3 survivors (3072K) Metaspace used 2835K, capacity 4596K, committed 4864K, reserved 1056768K class space used 301K, capacity 424K, committed 512K, reserved 1048576K } {Heap before GC invocations=1 (full 0): garbage-first heap total 262144K, used 19885K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000) region size 1024K, 18 young (18432K), 3 survivors (3072K) Metaspace used 2843K, capacity 4596K, committed 4864K, reserved 1056768K class space used 301K, capacity 424K, committed 512K, reserved 1048576K Heap after GC invocations=2 (full 0): garbage-first heap total 262144K, used 9072K [0xfffffffe60400000, 0xfffffffe60500800, 0xffffffff5e400000) region size 1024K, 3 young (3072K), 3 survivors (3072K) Metaspace used 2843K, capacity 4596K, committed 4864K, reserved 1056768K class space used 301K, capacity 424K, committed 512K, reserved 1048576K } -XX:+PrintHeapAtGC
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 27 bash-3.2$ java -Xlog:gc+heap=debug GCTest [0.113s][info][gc,heap] Heap region size: 1M [0.113s][debug][gc,heap] Minimum heap 8388608 Initial heap 268435456 Maximum heap 4261412864 [2.529s][debug][gc,heap] GC(0) Heap before GC invocations=0 (full 0): [2.529s][debug][gc,heap] GC(0) garbage-first heap total 262144K, used 26624K [0xfffffffe50400000, 0xfffffffe50500800, 0xffffffff4e400000) [2.529s][debug][gc,heap] GC(0) region size 1024K, 24 young (24576K), 0 survivors (0K) [2.530s][debug][gc,heap] GC(0) Metaspace used 4719K, capacity 4844K, committed 5120K, reserved 1056768K [2.530s][debug][gc,heap] GC(0) class space used 413K, capacity 464K, committed 512K, reserved 1048576K [2.892s][info ][gc,heap] GC(0) Eden regions: 24->0(9) [2.892s][info ][gc,heap] GC(0) Survivor regions: 0->3(3) [2.892s][info ][gc,heap] GC(0) Old regions: 0->2 [2.892s][info ][gc,heap] GC(0) Humongous regions: 2->1 [2.893s][debug][gc,heap] GC(0) Heap after GC invocations=1 (full 0): [2.893s][debug][gc,heap] GC(0) garbage-first heap total 262144K, used 5850K [0xfffffffe50400000, 0xfffffffe50500800, 0xffffffff4e400000) [2.893s][debug][gc,heap] GC(0) region size 1024K, 3 young (3072K), 3 survivors (3072K) [2.893s][debug][gc,heap] GC(0) Metaspace used 4719K, capacity 4844K, committed 5120K, reserved 1056768K [2.893s][debug][gc,heap] GC(0) class space used 413K, capacity 464K, committed 512K, reserved 1048576K [3.107s][debug][gc,heap] GC(1) Heap before GC invocations=1 (full 0): [3.107s][debug][gc,heap] GC(1) garbage-first heap total 262144K, used 15066K [0xfffffffe50400000, 0xfffffffe50500800, 0xffffffff4e400000) [3.108s][debug][gc,heap] GC(1) region size 1024K, 12 young (12288K), 3 survivors (3072K) [3.108s][debug][gc,heap] GC(1) Metaspace used 4726K, capacity 4844K, committed 5120K, reserved 1056768K [3.108s][debug][gc,heap] GC(1) class space used 413K, capacity 464K, committed 512K, reserved 1048576K [3.158s][info ][gc,heap] GC(1) Eden regions: 9->0(10) [3.158s][info ][gc,heap] GC(1) Survivor regions: 3->2(2) […] -Xlog:gc+heap=debug
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 28 bash-3.2$ java -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+UseG1GC GCTest Application time: 0.6692265 seconds Total time for which application threads were stopped: 0.0006422 seconds, Stopping threads took: 0.0003064 seconds Application time: 0.6252223 seconds Total time for which application threads were stopped: 0.0847633 seconds, Stopping threads took: 0.0002372 seconds Application time: 0.3719981 seconds Total time for which application threads were stopped: 0.0607710 seconds, Stopping threads took: 0.0002263 seconds Application time: 0.6516762 seconds Total time for which application threads were stopped: 0.0802199 seconds, Stopping threads took: 0.0004294 seconds Application time: 0.7976582 seconds Total time for which application threads were stopped: 0.0741299 seconds, Stopping threads took: 0.0002259 seconds Application time: 0.6417216 seconds Total time for which application threads were stopped: 0.0006499 seconds, Stopping threads took: 0.0002845 seconds Application time: 0.1142872 seconds Total time for which application threads were stopped: 0.0851334 seconds, Stopping threads took: 0.0002213 seconds Application time: 0.2681632 seconds Total time for which application threads were stopped: 0.0004676 seconds, Stopping threads took: 0.0002502 seconds Application time: 0.0046448 seconds Total time for which application threads were stopped: 0.0003611 seconds, Stopping threads took: 0.0001791 seconds […] -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 29 bash-3.2$ java -Xlog:safepoint GCTest [1.376s][info][safepoint] Application time: 0.3091519 seconds [1.377s][info][safepoint] Total time for which application threads were stopped: 0.0004600 seconds, Stopping threads took: 0.0002648 seconds [2.386s][info][safepoint] Application time: 1.0091637 seconds [2.387s][info][safepoint] Total time for which application threads were stopped: 0.0005217 seconds, Stopping threads took: 0.0002297 seconds [2.430s][info][safepoint] Application time: 0.0423349 seconds [2.784s][info][safepoint] Total time for which application threads were stopped: 0.3548135 seconds, Stopping threads took: 0.0002130 seconds [2.992s][info][safepoint] Application time: 0.2072894 seconds [3.040s][info][safepoint] Total time for which application threads were stopped: 0.0475234 seconds, Stopping threads took: 0.0002285 seconds [3.294s][info][safepoint] Application time: 0.2541180 seconds [3.333s][info][safepoint] Total time for which application threads were stopped: 0.0388724 seconds, Stopping threads took: 0.0002681 seconds [3.617s][info][safepoint] Application time: 0.2836815 seconds [3.661s][info][safepoint] Total time for which application threads were stopped: 0.0440203 seconds, Stopping threads took: 0.0002210 seconds [3.957s][info][safepoint] Application time: 0.2964698 seconds [4.089s][info][safepoint] Total time for which application threads were stopped: 0.1313429 seconds, Stopping threads took: 0.0002244 seconds [4.717s][info][safepoint] Application time: 0.6276530 seconds [4.827s][info][safepoint] Total time for which application threads were stopped: 0.1104660 seconds, Stopping threads took: 0.0002243 seconds […] -Xlog:safepoint
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 30 bash-3.2$ java -XX:+PrintAdaptiveSizePolicy -XX:+UseG1GC GCTest 0.323: [G1Ergonomics (Heap Sizing) expand the heap, requested expansion amount: 268435456 bytes, attempted expansion amount: 268435456 bytes] 2.544: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 0, predicted base time: 10.00 ms, remaining time: 190.00 ms, target pause time: 200.00 ms] 2.544: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 24 regions, survivors: 0 regions, predicted young region time: 367.19 ms] 2.545: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 24 regions, survivors: 0 regions, old: 0 regions, predicted pause time: 377.19 ms, target pause time: 200.00 ms] 3.013: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 6159, predicted base time: 33.53 ms, remaining time: 166.47 ms, target pause time: 200.00 ms] 3.013: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 16 regions, survivors: 3 regions, predicted young region time: 189.82 ms] 3.013: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 16 regions, survivors: 3 regions, old: 0 regions, predicted pause time: 223.35 ms, target pause time: 200.00 ms] 3.723: [G1Ergonomics (CSet Construction) start choosing CSet, _pending_cards: 6657, predicted base time: 27.44 ms, remaining time: 172.56 ms, target pause time: 200.00 ms] 3.723: [G1Ergonomics (CSet Construction) add young regions to CSet, eden: 26 regions, survivors: 3 regions, predicted young region time: 188.88 ms] 3.723: [G1Ergonomics (CSet Construction) finish choosing CSet, eden: 26 regions, survivors: 3 regions, old: 0 regions, predicted pause time: 216.32 ms, target pause time: 200.00 ms] […] -XX:+PrintAdaptiveSizePolicy
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 31 bash-3.2$ java -Xlog:gc+ergo*=trace GCTest [0.122s][debug][gc,ergo,refine] Initial Refinement Zones: green: 23, yellow: 69, red: 115, min yellow size: 46 [0.142s][debug][gc,ergo,heap ] Expand the heap. requested expansion amount:268435456B expansion amount:268435456B [2.475s][trace][gc,ergo,cset ] GC(0) Start choosing CSet. pending cards: 0 predicted base time: 10.00ms remaining time: 190.00ms target pause time: 200.00ms [2.476s][trace][gc,ergo,cset ] GC(0) Add young regions to CSet. eden: 24 regions, survivors: 0 regions, predicted young region time: 367.19ms, target pause time: 200.00ms [2.476s][debug][gc,ergo,cset ] GC(0) Finish choosing CSet. old: 0 regions, predicted old region time: 0.00ms, time remaining: 0.00 [2.826s][debug][gc,ergo ] GC(0) Running G1 Clear Card Table Task using 1 workers for 1 units of work for 24 regions. [2.827s][debug][gc,ergo ] GC(0) Running G1 Free Collection Set using 1 workers for collection set length 24 [2.828s][trace][gc,ergo,refine] GC(0) Updating Refinement Zones: update_rs time: 0.004ms, update_rs buffers: 0, update_rs goal time: 19.999ms [2.829s][debug][gc,ergo,refine] GC(0) Updated Refinement Zones: green: 23, yellow: 69, red: 115 [3.045s][trace][gc,ergo,cset ] GC(1) Start choosing CSet. pending cards: 5898 predicted base time: 26.69ms remaining time: 173.31ms target pause time: 200.00ms [3.045s][trace][gc,ergo,cset ] GC(1) Add young regions to CSet. eden: 9 regions, survivors: 3 regions, predicted young region time: 457.38ms, target pause time: 200.00ms [3.045s][debug][gc,ergo,cset ] GC(1) Finish choosing CSet. old: 0 regions, predicted old region time: 0.00ms, time remaining: 0.00 [3.090s][debug][gc,ergo ] GC(1) Running G1 Clear Card Table Task using 1 workers for 1 units of work for 12 regions. [3.091s][debug][gc,ergo ] GC(1) Running G1 Free Collection Set using 1 workers for collection set length 12 [3.093s][trace][gc,ergo,refine] GC(1) Updating Refinement Zones: update_rs time: 2.510ms, update_rs buffers: 25, update_rs goal time: 19.999ms [3.093s][debug][gc,ergo,refine] GC(1) Updated Refinement Zones: green: 25, yellow: 75, red: 125 […] -Xlog:gc+ergo*=trace
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 32 bash-3.2$ java -XX:+PrintTenuringDistribution -XX:MaxTenuringThreshold=15 -XX:+UseG1GC GCTest Desired survivor size 1048576 bytes, new threshold 15 (max 15) - age 1: 143280 bytes, 143280 total Desired survivor size 9961472 bytes, new threshold 15 (max 15) - age 1: 1679496 bytes, 1679496 total - age 2: 115912 bytes, 1795408 total Desired survivor size 8912896 bytes, new threshold 1 (max 15) - age 1: 17444896 bytes, 17444896 total - age 2: 787568 bytes, 18232464 total - age 3: 89512 bytes, 18321976 total Desired survivor size 7340032 bytes, new threshold 1 (max 15) - age 1: 17357168 bytes, 17357168 total -XX:+PrintTenuringDistribution
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 33 bash-3.2$ java -Xlog:gc+age=trace GCTest [2.406s][debug][gc,age] GC(0) Desired survivor size 1572864 bytes, new threshold 15 (max threshold 15) [2.745s][trace][gc,age] GC(0) Age table with threshold 15 (max threshold 15) [2.745s][trace][gc,age] GC(0) - age 1: 3100640 bytes, 3100640 total [2.964s][debug][gc,age] GC(1) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15) [3.011s][trace][gc,age] GC(1) Age table with threshold 1 (max threshold 15) [3.011s][trace][gc,age] GC(1) - age 1: 1928480 bytes, 1928480 total [3.267s][debug][gc,age] GC(2) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15) [3.304s][trace][gc,age] GC(2) Age table with threshold 1 (max threshold 15) [3.304s][trace][gc,age] GC(2) - age 1: 1985736 bytes, 1985736 total [3.600s][debug][gc,age] GC(3) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15) [3.641s][trace][gc,age] GC(3) Age table with threshold 1 (max threshold 15) [3.641s][trace][gc,age] GC(3) - age 1: 2005984 bytes, 2005984 total [3.937s][debug][gc,age] GC(4) Desired survivor size 1048576 bytes, new threshold 1 (max threshold 15) [3.981s][trace][gc,age] GC(4) Age table with threshold 1 (max threshold 15) [3.982s][trace][gc,age] GC(4) - age 1: 2076584 bytes, 2076584 total [4.700s][debug][gc,age] GC(5) Desired survivor size 2097152 bytes, new threshold 15 (max threshold 15) [4.810s][trace][gc,age] GC(5) Age table with threshold 15 (max threshold 15) [4.810s][trace][gc,age] GC(5) - age 1: 2658280 bytes, 2658280 total [4.810s][trace][gc,age] GC(5) - age 2: 1527360 bytes, 4185640 total [5.205s][debug][gc,age] GC(6) Desired survivor size 2097152 bytes, new threshold 1 (max threshold 15) […] -Xlog:gc+age=trace
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | -Xloggc:<file>, UseGCLogFileRotation, NumberOfGCLogFiles, GCLogFileSize • bash-3.2$ java -Xloggc:gc.old.log -XX:+UseGCLogFileRotation - XX:NumberOfGCLogFiles=3 -XX:+UseG1GC GCTest • Log files – gc.old.log.0 – gc.old.log.1 – gc.old.log.2.current 34
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | -Xlog:gc*:file=<file>::filecount=<count>,filesize=<filesize in kb> • bash-3.2$ java -Xlog:gc*:file=gc.new.log::filecount=3,filesize=1024 GCTest • Log Files: – gc.new.log – gc.new.log.1 – gc.new.log.0 – gc.new.log.2 35
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Other Useful Tags • -Xlog:gc*=trace (all of gc logging at the lowest level) • -Xlog:all=trace (all the JVM logging at the lowest level) • -Xlog:disable (disable all logging) • -Xlog:help (syntax and examples) • -Xlog:logging=trace (logging for the logging framework) 36
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 37 bash-3.2$ java -Xlog:logging=trace GCTest [0.604s][info][logging] Log configuration fully initialized. [0.604s][debug][logging] Available log levels: off, trace, debug, info, warning, error [0.604s][debug][logging] Available log decorators: time (t), utctime (utc), uptime (u), timemillis (tm), uptimemillis (um), timenanos (tn), uptimenanos (un), hostname (hn), pid (p) , tid (ti), level (l), tags (tg) [0.604s][debug][logging] Available log tags: add, age, alloc, aot, annotation, arguments, attach, barrier, biasedlocking, blocks, bot, breakpoint, census, class, classhisto, cleanu p, compaction, constraints, constantpool, coops, cpu, cset, data, defaultmethods, dump, ergo, exceptions, exit, fingerprint, freelist, gc, hashtables, heap, humongous, ihop, iklass , init, itables, jni, jvmti, liveness, load, loader, logging, mark, marking, methodcomparator, metadata, metaspace, mmu, modules, monitorinflation, monitormismatch, nmethod, normal ize, objecttagging, obsolete, oopmap, os, pagesize, patch, path, phases, plab, promotion, preorder, protectiondomain, ref, redefine, refine, region, remset, purge, resolve, safepoi nt, scavenge, scrub, stacktrace, stackwalk, start, startuptime, state, stats, stringdedup, stringtable, stackmap, subclass, survivor, sweep, task, thread, tlab, time, timer, update , unload, verification, verify, vmoperation, vtables, workgang, jfr, system, parser, bytecode, setting, event [0.604s][debug][logging] Described tag combinations: [0.604s][debug][logging] logging: Logging for the log framework itself [0.605s][debug][logging] Log output configuration:
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 38 [0.605s][debug][logging] #0: stdout os+cpu=warning,vmoperation=warning,verification=warning,ref=warning,modules+startuptime=warnin g,monitorinflation=warning,stackwalk=warning,safepoint+cleanup=warning,gc+ref+start=warning,gc +ref=warning,ergo=warning,gc+compaction=warning,os+thread=warning,safepoint=warning,pagesize=w arning,os=warning,redefine+class+oopmap=warning,redefine+class+nmethod=warning,modules+patch=w arning,redefine+class+methodcomparator=warning,startuptime=warning,gc+metaspace+freelist+block s=warning,gc+metaspace+alloc=warning,gc+metaspace=warning,gc+metaspace+freelist=warning,class+ loader+constraints=warning,vtables=warning,itables=warning,redefine+class+update+itables=warni ng,redefine+class+obsolete+metadata=warning,redefine+class+timer=warning,redefine+class+normal ize=warning,redefine+class+load=warning,redefine+class+load+exceptions=warning,redefine+class+ constantpool=warning,redefine+class+annotation=warning,redefine+class+stackmap=warning,redefin e+class+obsolete+mark=warning,redefine+class+subclass=warning,redefine+class=warning,redefine+ class+dump=warning,redefine+class+breakpoint=warning,jvmti+objecttagging=warning,jvmti=warning ,jfr+system+event=warning,jfr+system+setting=warning,jfr+system+bytecode=warning,jfr+system+pa rser=warning,jfr+system+metadata=warning,jfr+metadata=warning,jfr+event=warning,jfr+setting=wa rning,jfr=warning,jfr+system=warning,stacktrace=warning,gc+heap+exit=warning,redefine+class+ob solete=warning,class+init=warning,modules=warning,redefine+class+update+vtables=warning,redefi ne+class+iklass+purge=warning,redefine+class+iklass+add=warning,monitormismatch=warning,gc+cpu =warning,gc+task+thread=warning,gc+task+time=warning,gc+jni=warning,gc+stringdedup=warning,gc+ marking+start=warning,gc+remset=warning,gc+remset+exit=warning,gc+verify+start=warning,gc+ihop =warning,gc+phases+task=warning,gc+stats=warning,gc+ergo+cset=warning,gc+stringtable=warning,g c+heap+region=warning,gc+task+stats=warning,gc+humongous=warning,gc+region=warning,protectiond omain=warning,gc+ergo+ihop=warning,gc+scavenge=warning,gc+mmu=warning,defaultmethods=warning,g c+ergo+heap=warning,redefine+class+update=warning […]
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 39 bash-3.2$ jcmd 29688 VM.log 29688: Syntax : VM.log [options] Options: (options must be specified using the <key> or <key>=<value> syntax) output : [optional] The name or index (#<index>) of output to configure. (STRING, no default value) output_options : [optional] Options for the output. (STRING, no default value) what : [optional] Configures what tags to log. (STRING, no default value) decorators : [optional] Configures which decorators to use. Use 'none' or an empty value to remove all. (STRING, no default value) disable : [optional] Turns off all logging and clears the log configuration. (BOOLEAN, no default value) list : [optional] Lists current log configuration. (BOOLEAN, no default value) rotate : [optional] Rotates all logs. (BOOLEAN, no default value) bash-3.2$ jcmd 29688 VM.log what=gc* 4460: Command executed successfully Runtime Configuration of -Xlog
  • 40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 40 Old GC logging option Equivalent –Xlog:gc configuration G1PrintHeapRegions -Xlog:gc+region=trace G1PrintRegionLivenessInfo -Xlog:gc+liveness=trace G1SummarizeConcMark -Xlog:gc+marking=trace G1SummarizeRSetStats -Xlog:gc+remset*=trace GCLogFileSize, NumberOfGCLogFiles, UseGCLogFileRotation -Xlog:gc*:file=<file>::filecount=<count>,filesize=<filesize in kb> PrintAdaptiveSizePolicy -Xlog:gc+ergo*=trace PrintClassHistogramAfterFullGC -Xlog:classhisto*=trace PrintClassHistogramBeforeFullGC -Xlog:classhisto*=trace PrintGCApplicationConcurrentTime -Xlog:safepoint PrintGCApplicationStoppedTime -Xlog:safepoint PrintGCCause Always logged PrintGCDateStamps ‘time’ decorator PrintGCID Always logged
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 41 Old GC logging option Equivalent –Xlog:gc configuration PrintGCTaskTimeStamps -Xlog:gc+task=trace PrintGCTimeStamps ‘uptime’ decorator PrintHeapAtGC -Xlog:gc+heap=debug PrintHeapAtGCExtended -Xlog:gc+heap=trace PrintJNIGCStalls -Xlog:gc+jni=debug PrintOldPLAB -Xlog:gc+plab=trace PrintParallelOldGCPhaseTimes -Xlog:gc+phases=trace PrintPLAB -Xlog:gc+plab=trace PrintPromotionFailure -Xlog:gc+promotion=debug PrintReferenceGC -Xlog:gc+ref=debug PrintStringDeduplicationStatistics -Xlog:gc+stringdedup PrintTaskqueue -Xlog:gc+task+stats=trace PrintTenuringDistribution -Xlog:gc+age=trace
  • 42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 42 Old GC logging option Equivalent –Xlog:gc configuration PrintTerminationStats -Xlog:gc+task+stats=debug PrintTLAB -Xlog:gc+tlab=trace TraceAdaptiveGCBoundary -Xlog:heap+ergo=debug TraceDynamicGCThreads -Xlog:gc+task=trace TraceMetadataHumongousAllocation -Xlog:gc+metaspace+alloc=debug G1TraceConcRefinement -Xlog:gc+refine=debug G1TraceEagerReclaimHumongousObjects -Xlog:gc+humongous=debug G1TraceStringSymbolTableScrubbing -Xlog:gc+stringtable=trace
  • 43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 43