Unfortunately, a lot of Garbage collection log analysis tools doesn’t give this clarity, they only publish ‘Total Duration’.
When you are calculating ‘Throughput’ or ‘Latency’ in Garbage Collection analysis, it should be based on ‘GC Pause Duration’. Thus, when you are tuning your application, you need to focus primarily on the ‘GC Pause Duration’ and not on the ‘GC Duration’ or GC ‘Concurrent Duration’. Because there are 2 concurrent phases – Root Region Scanning, Concurrent Marking. GC Concurrent DurationĬoncurrent Duration of this event is 1 second. Because there are 3 Stop the world phases – Initial Mark, Cleanup, Remark. Pause Duration of this event is 1.5 seconds. So, 5 x 0.5 seconds = 2.5 seconds GC Pause Duration Because there are 5 phases and each phase took 0.5 seconds. Total Duration of this event is 2.5 seconds. Let’s say, in an old generation G1 GC event, each phase took 0.5 seconds. Refer to the below table: CMS GC PhaseĮquipped with this knowledge, let’s study the difference between GC Duration, GC Pause Duration, and Concurrent GC Duration. Other 4 phases run concurrently with application threads. In those 6 phases, only 2 of them pause the application threads completely. Similarly, CMS old generation GC has 6 phases. Other 2 phases run concurrently with application threads without pausing the application threads. In those 5 phases, only 3 of them pause the application threads completely. For example, if you are using G1 GC algorithm, old generation GC event has 5 phases. An event that partially pause the application.When “Young GC” runs, the entire application is paused for the duration till it completes. Against most common belief, “Young GC” falls under this category. No customer transactions will be processed during this event. These events are also called “Stop the world events”. An event that fully pause the application.In Garbage Collection, there are two types of events: Let’s answer these questions in this article. From where can I get ‘GC Duration’ and ‘GC Pause Duration’ time period?.What is the difference between ‘GC Pause Duration’ & ‘GC Duration’?.Why should I base my study on the ‘GC Pause Duration’?.When you are studying application’s Garbage Collection performance, you need to base your study on the ‘GC Pause Duration’ rather than ‘GC Duration’.