What is the unit of YGCT in jstat output
Asked Answered
L

2

9
 S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CCSU   YGC     YGCT    FGC    FGCT     GCT   
245760.0 245760.0 33804.8  0.0   1966080.0 364994.1 8028160.0   138003.6  25984.0 25429.9 2944.0 2877.2      8    0.451   2      0.153    0.603

This is the output of ./jstat -gc pid 250ms 0 I want to know what is the unit YGCT or FGCT? i.e. us or ms?

Lopes answered 10/6, 2015 at 7:48 Comment(0)
I
5

The unit is second according to https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html.

Is not explicitly stated but it is easy to grasp from the paragraph Using the gcutil option:

The output of this example shows that a young generation collection occurred between the 3rd and 4th sample. The collection took 0.001 seconds and promoted objects ...

0.001 is the difference between 2 sequential YGCT because is about a young generation collection; check the paragraph at the link above in order to learn more about the context.

Accepting seconds as the unit for YGCT while also considering that would be illogical/confusing to have something else for FGCT than one could conclude that seconds is also the unit for FGCT.

UPDATE

jstat for java 8, jstat for java 9, jstat for java 10 and jstat for java 11 all offer the same example but with other values than mentioned here; see The collection took 0.078 seconds paragraph. I stress again that is important to understand what the time measuring is for (YGCT) and why (because is about a young generation collection).

Interwork answered 12/2, 2018 at 13:18 Comment(5)
I do not think this is correct. I initially came to the same conclusion from the docs. But look at this output. S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 37376.0 38400.0 0.0 15277.9 6174208.0 2819349.5 2595840.0 2082461.3 87680.0 83317.5 10624.0 9802.4 8293 176.194 5 1.463 177.656 GCT, which I believe should be the sum of the other *GCT values, is 1.463, vs. 8293 and 5. (Sorry cannot figure out how to block format in a comment.)Baldheaded
It seems that you are miss interpreting the values. In fact is GCT = YGCT + FGCT so 177.656 ~= 177.657 = 176.194 + 1.463 The 0.001 difference (you’ll notice it in documentation too for GCT) I don’t know exactly where it comes from (from some rounding maybe?). From Using the gcutil option you have YGCT + FGCT = GCT where row3: 0.176 + 0.495 = 0.761 ~= 0.672 and row4: 0.177 + 0.495 = 0.762 ~= 0.673 and GCT4 - GCT3 = 0.673 - 0.672 = 0.001 (according to doc). So because GCT ~= YGCT + FGCT I again conclude YGCT and FGCT are seconds. Still waiting the explanation for the bad reputation mark :).Interwork
Ha! In monospace in my terminal, it looked visually aligned at casual glance, but it actually wasn't. So I was reading the wrong numbers. I now agree with you. I'll give you my +1, but the -1 wasn't me! :-)Baldheaded
I appreciate that you tried to see the value of my answer before deciding to vote :)Interwork
I think these are CPU seconds, not wall clock seconds. So if you have 4 CPUs and parallel GC, GCT might increase by 40 over a 10 second wall clock interval.Klong
G
5

The unit is seconds.

YGCT - stands for Young generation garbage collection time

FGCT - stands for Full garbage collection time

Both values sum up the time the GC takes for the specific task.

Glimpse answered 21/7, 2015 at 11:20 Comment(1)
Pumped to find this answer - but what tells you that it's seconds?Elide
I
5

The unit is second according to https://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html.

Is not explicitly stated but it is easy to grasp from the paragraph Using the gcutil option:

The output of this example shows that a young generation collection occurred between the 3rd and 4th sample. The collection took 0.001 seconds and promoted objects ...

0.001 is the difference between 2 sequential YGCT because is about a young generation collection; check the paragraph at the link above in order to learn more about the context.

Accepting seconds as the unit for YGCT while also considering that would be illogical/confusing to have something else for FGCT than one could conclude that seconds is also the unit for FGCT.

UPDATE

jstat for java 8, jstat for java 9, jstat for java 10 and jstat for java 11 all offer the same example but with other values than mentioned here; see The collection took 0.078 seconds paragraph. I stress again that is important to understand what the time measuring is for (YGCT) and why (because is about a young generation collection).

Interwork answered 12/2, 2018 at 13:18 Comment(5)
I do not think this is correct. I initially came to the same conclusion from the docs. But look at this output. S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT 37376.0 38400.0 0.0 15277.9 6174208.0 2819349.5 2595840.0 2082461.3 87680.0 83317.5 10624.0 9802.4 8293 176.194 5 1.463 177.656 GCT, which I believe should be the sum of the other *GCT values, is 1.463, vs. 8293 and 5. (Sorry cannot figure out how to block format in a comment.)Baldheaded
It seems that you are miss interpreting the values. In fact is GCT = YGCT + FGCT so 177.656 ~= 177.657 = 176.194 + 1.463 The 0.001 difference (you’ll notice it in documentation too for GCT) I don’t know exactly where it comes from (from some rounding maybe?). From Using the gcutil option you have YGCT + FGCT = GCT where row3: 0.176 + 0.495 = 0.761 ~= 0.672 and row4: 0.177 + 0.495 = 0.762 ~= 0.673 and GCT4 - GCT3 = 0.673 - 0.672 = 0.001 (according to doc). So because GCT ~= YGCT + FGCT I again conclude YGCT and FGCT are seconds. Still waiting the explanation for the bad reputation mark :).Interwork
Ha! In monospace in my terminal, it looked visually aligned at casual glance, but it actually wasn't. So I was reading the wrong numbers. I now agree with you. I'll give you my +1, but the -1 wasn't me! :-)Baldheaded
I appreciate that you tried to see the value of my answer before deciding to vote :)Interwork
I think these are CPU seconds, not wall clock seconds. So if you have 4 CPUs and parallel GC, GCT might increase by 40 over a 10 second wall clock interval.Klong

© 2022 - 2024 — McMap. All rights reserved.