The t option shows the elapsed time since the JVM was executed, because I wanted to know the current time rather than that.
Find out the ID of the java process you want to monitor with the jps command.
The execution result is displayed every second, and the headline is displayed every 10 lines.
Execution command
jstat -gcutil -h 10 [java process id] 1000 | awk  -F, '{print strftime("%Y-%m-%d %H:%M:%S",systime()) $1}'
2019-03-17 11:39:38  S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT    CGC    CGCT    CT
2019-03-17 11:39:38  0.00 100.00  17.39  12.32  95.68  86.38      5    0.035     0    0.000     2    0.005    0.040
2019-03-17 11:39:39  0.00 100.00  17.39  12.32  95.68  86.38      5    0.035     0    0.000     2    0.005    0.040
2019-03-17 11:39:40  0.00 100.00  17.39  12.32  95.68  86.38      5    0.035     0    0.000     2    0.005    0.040
2019-03-17 11:39:41  0.00 100.00  17.39  12.32  95.68  86.38      5    0.035     0    0.000     2    0.005    0.040
2019-03-17 11:39:42  0.00 100.00  17.39  12.32  95.68  86.38      5    0.035     0    0.000     2    0.005    0.040
Recommended Posts