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?

Kumar Saras
  • 225
  • 1
  • 4
  • 9

2 Answers2

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.

Logarith
  • 690
  • 1
  • 7
  • 27
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).

Adrian
  • 3,321
  • 2
  • 29
  • 46
  • 1
    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.) – Lorrin Mar 07 '18 at 23:30
  • 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 :). – Adrian Mar 09 '18 at 05:56
  • 1
    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! :-) – Lorrin Mar 10 '18 at 18:06
  • I appreciate that you tried to see the value of my answer before deciding to vote :) – Adrian Sep 29 '18 at 08:39
  • 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. – hfs May 08 '19 at 09:00