"-XX:+PrintGCApplicationConcurrentTime" - Application Running Durations

This section describes the garbage collection logging option, '-XX:+PrintGCApplicationConcurrentTime', which prints how much time it lasted when the JVM pauses the execution of the application for garbage collection or other JVM event.

In this tutorial, let's try the "-XX:+PrintGCApplicationConcurrentTime" garbage collection logging option to see what we will get in the log file:

C:\>\progra~1\java\jdk1.8.0\bin\java -Xms2m -Xmx64m 
   -XX:+PrintGCApplicationConcurrentTime -Xloggc:gc.log  
   GarbageCollection

Step/TotalMemory/FreeMemory/UsedMemory:
1   2031616   698848   1332768
2   3874816   1473392   2401424
3   3874816   425688   3449128
4   8970240   4442016   4528224
...
(Ctrl-C)

C:\>type gc.log
CommandLine flags: -XX:InitialHeapSize=2097152 -XX:MaxHeapSize=67108864 
   -XX:+PrintGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCTimeStamps 
   -XX:-UseLargePagesIndividualAllocation 
0.150: Application time: 0.0104111 seconds
0.150: [GC (Allocation Failure)  889K->755K(1984K), 0.0021081 secs]
1.143: Application time: 0.9908461 seconds
1.143: [GC (Allocation Failure)  1557K->1540K(2500K), 0.0030726 secs]
1.147: [Full GC (Allocation Failure)  1540K->1540K(2500K), 0.0019443 secs]
2.144: Application time: 0.9950688 seconds
2.144: [GC (Allocation Failure)  2601K->2580K(3784K), 0.0034062 secs]
...

Notes on the output:

Obviously, reporting how much time the application are occurred running without any pauses does help if you want to troubleshoot any performance issues. So you should use "-XX:+PrintGCApplicationConcurrentTime" all the time.

Last update: 2018.

Table of Contents

 About This Book

 Heap Memory Area and Size Control

JVM Garbage Collection Logging

 Garbage Collection Demo Program

 Garbage Collection Logging Options

 "-XX:+PrintGC" - GC Logging Option for Short Messages

 "-XX:+PrintGCDetails" - Option for Detailed GC Messages

 "-XX:+PrintGCDateStamps" - Calendar Timestamp on GC Messages

 "-XX:+PrintGCApplicationStoppedTime" - Application Pause Durations

"-XX:+PrintGCApplicationConcurrentTime" - Application Running Durations

 "-XX:+PrintHeapAtGC" - Print Heap Summary per GC

 "-XX:+PrintTenuringDistribution" - Tunuring Distribution

 "-XX:+PrintReferenceGC" - Reference Counts per GC

 "-XX:+PrintFlagsFinal" - Print JVM Options

 Introduction of Garbage Collectors

 Serial Collector - "+XX:+UseSerialGC"

 Parallel Collector - "+XX:+UseParallelGC"

 Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"

 Garbage First (G1) Collector - "+XX:+UseG1GC"

 Object References and Garbage Collection

 Garbage Collection Performance Test Program

 Performance Tests on Serial Collector

 Performance Tests on Parallel collector

 Performance Tests on Concurrent collector

 Performance Tests on G1 collector

 Garbage Collection Performance Test Summary

 Outdated Tutorials

 References

 Full Version in PDF/EPUB