Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8245129: Enhance jstat gc option output and tests
Widen and right-justify size fields assuming 2tb heap

Reviewed-by: simonis, dtitov
  • Loading branch information
Paul Hohensee committed Jun 29, 2020
1 parent ba711f6 commit 51b7c76a954d2dd2d81d83e737d56abf06ced843
Show file tree
Hide file tree
Showing 33 changed files with 338 additions and 216 deletions.

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
* Results of running the JstatGcTool ("jstat -gccapacity <pid>")
*
* Output example:
* NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC YGC FGC
* 41984.0 671744.0 41984.0 5248.0 5248.0 31488.0 83968.0 1343488.0 83968.0 83968.0 512.0 110592.0 4480.0 0 0
* NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC
* 0.0 4194304.0 6144.0 0.0 2048.0 4096.0 0.0 4194304.0 2048.0 2048.0 0.0 1056768.0 7680.0 0.0 1048576.0 768.0 4 0 0
*
* Output description:
* NGCMN Minimum new generation capacity (KB).
* NGCMX Maximum new generation capacity (KB).
@@ -25,9 +25,9 @@
* Results of running the JstatGcTool ("jstat -gccause <pid>")
*
* Output example:
* S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC
* 0.00 6.25 46.19 0.34 57.98 54.63 15305 1270.551 0 0.000 0 0.00 1270.551 Allocation Failure No GC
* S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC
* 0.00 0.00 0.00 53.70 97.40 92.67 4 0.286 19 17.890 2 0.086 18.263 System.gc() No GC
*
* Output description:
* S0 Survivor space 0 utilization as a percentage of the space's current capacity.
* S1 Survivor space 1 utilization as a percentage of the space's current capacity.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@
* Results of running the JstatGcTool ("jstat -gcnew <pid>")
*
* Output example:
* S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
* 0.0 7168.0 0.0 7168.0 15 15 3584.0 62464.0 5120.0 27 0.340
* S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
* 0.0 2048.0 0.0 1113.5 15 15 1024.0 4096.0 0.0 4 0.228
*
* Output description:
* S0C Current survivor space 0 capacity (KB).
* S1C Current survivor space 1 capacity (KB).
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,8 +25,8 @@
* Results of running the JstatGcTool ("jstat -gc <pid>")
*
* Output example:
* S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT
* 512.0 512.0 32.0 0.0 288768.0 168160.6 83968.0 288.1 4864.0 2820.3 512.0 279.7 18510 1559.208 0 0.000 0 0.0 1559.208
* S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT
* 0.0 2048.0 0.0 1079.5 4096.0 0.0 2048.0 0.0 7680.0 7378.6 768.0 664.7 4 0.140 0 0.000 0 0.000 0.140
*
* Output description:
* S0C Current survivor space 0 capacity (KB).
@@ -3,18 +3,20 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# S0 S1 E O P YGC YGCT FGC FGCT GCT
# 0.00 100.00 68.87 1.24 27.75 1 0.044 0 0.000 0.044
# -gcutil
#
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT
# 0.00 0.00 0.00 47.17 97.15 92.31 20 0.335 696 334.382 2 0.069 334.786

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ S0 S1 E O P YGC YGCT FGC FGCT GCT $/ {
/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT $/ {
headerlines++;
}

/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ {
/^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ {
datalines++;
}

@@ -3,15 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC
# 4096.0 657408.0 8192.0 512.0 512.0 3072.0 6144.0 1312768.0 6144.0 6144.0 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0

# -gccapacity 0
#
# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC
# 0.0 4194304.0 6144.0 0.0 2048.0 4096.0 0.0 4194304.0 2048.0 2048.0 0.0 1056768.0 7680.0 0.0 1048576.0 768.0 4 0 0
#
# -J-XX:+UseParallelGC -gccapacity 0
#
# NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC
# 1536.0 1397760.0 8192.0 1024.0 512.0 3072.0 512.0 2796544.0 5632.0 5632.0 0.0 1056768.0 8320.0 0.0 1048576.0 896.0 5 0 -

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC $/ {
/^ NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC CGC $/ {
headerlines++;
}

@@ -3,16 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC
# 0.00 0.00 0.00 9.97 90.94 87.70 2 0.013 0 0.000 0 0.000 0.013 Allocation Failure No GC
# 0.00 0.00 82.15 0.00 - - 0 0.000 0 0.000 - - 0.000 No GC No GC

# -gccause 0
#
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC
# 0.00 54.68 0.00 0.00 94.02 84.11 4 0.269 0 0.000 0 0.000 0.269 G1 Evacuation Pause No GC
#
# -J-XX:+UseSerialGC -gccause 0
#
# S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC
# 78.14 0.00 68.23 15.57 94.69 88.17 4 0.204 0 0.000 - - 0.204 Allocation Failure No GC

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC $/ {
/^ S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT LGCC GCC $/ {
headerlines++;
}

@@ -3,14 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT
# 512.0 132096.0 5120.0 512.0 131072.0 512.0 1 0 0.000 0 0.000 0.004
# -gcmetacapacity 0
#
# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT
# 0.0 1056768.0 8832.0 0.0 1048576.0 896.0 5 0 0.000 0 0.000 0.245
#
# -J-XX:+UseParallelGC -gcmetacapacity 0
#
# MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT
# 0.0 1056768.0 8064.0 0.0 1048576.0 896.0 4 0 0.000 - - 0.113

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT $/ {
/^ MCMN MCMX MC CCSMN CCSMX CCSC YGC FGC FGCT CGC CGCT GCT $/ {
headerlines++;
}

@@ -3,15 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC
# 2176.0 7232.0 2176.0 192.0 64.0 192.0 64.0 6848.0 2048.0 1 0 0

# -gcnewcapacity 0
#
# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC
# 0.0 4194304.0 6144.0 0.0 0.0 4194304.0 2048.0 4194304.0 4096.0 4 0 0
#
# -J-XX:+UseParallelGC -gcnewcapacity 0
#
# NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC
# 1536.0 1397760.0 7168.0 465920.0 512.0 465920.0 512.0 1396736.0 6144.0 4 0 -

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC $/ {
/^ NGCMN NGCMX NGC S0CMX S0C S1CMX S1C ECMX EC YGC FGC CGC $/ {
headerlines++;
}

@@ -3,16 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
# 64.0 64.0 0.0 64.0 1 31 32.0 2048.0 41.4 1 0.031


# -gcnew 0
#
# S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
# 0.0 2048.0 0.0 1113.5 15 15 1024.0 4096.0 0.0 4 0.228
#
# -J-XX:+UseParallelGC -gcnew 0
#
# S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
# 1024.0 512.0 0.0 512.0 6 15 1024.0 3072.0 830.1 5 0.164

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT $/ {
/^ S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT $/ {

headerlines++;
}
@@ -3,14 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT
# 6016.0 58304.0 6016.0 6016.0 1 0 0.000 0 0.000 0.030
# -gcoldcapacity 0
#
# OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT
# 0.0 4194304.0 2048.0 2048.0 5 0 0.000 0 0.000 0.407
#
# -J-XX:+UseParallelGC -gcoldcpacity 0
#
# OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT
# 512.0 2796544.0 5632.0 5632.0 5 0 0.000 - - 0.180

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT $/ {
/^ OGCMN OGCMX OGC OC YGC FGC FGCT CGC CGCT GCT $/ {
headerlines++;
}

@@ -3,15 +3,21 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT
# 5120.0 4152.0 512.0 397.9 6144.0 200.0 1 0 0.000 0.005

# -gcold 0
#
# MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT
# 7680.0 7202.3 768.0 638.6 2048.0 0.0 4 0 0.000 0 0.000 0.240
#
# -J-XX:+UseParallelGC -gcold 0
#
# MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT
# 8320.0 7759.4 896.0 718.3 5632.0 904.1 5 0 0.000 - - 0.175

BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT $/ {
/^ MC MU CCSC CCSU OC OU YGC FGC FGCT CGC CGCT GCT $/ {
headerlines++;
}

@@ -3,15 +3,22 @@
# that the numerical values conform to a specific pattern, rather than
# specific values.
#
# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT
# 512.0 512.0 0.0 496.0 3072.0 615.5 6144.0 280.0 5120.0 4176.0 512.0 401.0 1 0.005 0 0.000 0 0.000 0.005
# -gc 0
#
# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT
# 0.0 2048.0 0.0 1079.5 4096.0 0.0 2048.0 0.0 7680.0 7378.6 768.0 664.7 4 0.140 0 0.000 0 0.000 0.140
#
# -J-XX:+UseParallelGC -gc 0
#
# S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT
# 512.0 512.0 512.0 0.0 6144.0 634.8 5632.0 748.1 8320.0 7851.5 896.0 730.2 4 0.171 0 0.000 - - 0.171


BEGIN {
headerlines=0; datalines=0; totallines=0
}

/^ S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT $/ {
/^ S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT CGC CGCT GCT $/ {
headerlines++;
}

@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,3 +34,4 @@ verify_os
JSTAT="${TESTJAVA}/bin/jstat"

${JSTAT} ${COMMON_JSTAT_FLAGS} -gccapacity 0 2>&1 | awk -f ${TESTSRC}/gcCapacityOutput1.awk
${JSTAT} ${COMMON_JSTAT_FLAGS} -J-XX:+UseParallelGC -gccapacity 0 2>&1 | awk -f ${TESTSRC}/gcCapacityOutput1.awk
@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -37,4 +37,5 @@ JSTAT="${TESTJAVA}/bin/jstat"
# class machine, ergonomics will automatically use UseParallelGC.
# The UseParallelGC collector does not currently update the gc cause counters.

${JSTAT} ${COMMON_JSTAT_FLAGS} -gccause 0 2>&1 | awk -f ${TESTSRC}/gcCauseOutput1.awk
${JSTAT} ${COMMON_JSTAT_FLAGS} -J-XX:+UseSerialGC -gccause 0 2>&1 | awk -f ${TESTSRC}/gcCauseOutput1.awk
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,3 +34,4 @@ verify_os
JSTAT="${TESTJAVA}/bin/jstat"

${JSTAT} ${COMMON_JSTAT_FLAGS} -gcmetacapacity 0 2>&1 | awk -f ${TESTSRC}/gcMetaCapacityOutput1.awk
${JSTAT} ${COMMON_JSTAT_FLAGS} -J-XX:+UseParallelGC -gcmetacapacity 0 2>&1 | awk -f ${TESTSRC}/gcMetaCapacityOutput1.awk
@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,3 +34,4 @@ verify_os
JSTAT="${TESTJAVA}/bin/jstat"

${JSTAT} ${COMMON_JSTAT_FLAGS} -gcnewcapacity 0 2>&1 | awk -f ${TESTSRC}/gcNewCapacityOutput1.awk
${JSTAT} ${COMMON_JSTAT_FLAGS} -J-XX:+UseParallelGC -gcnewcapacity 0 2>&1 | awk -f ${TESTSRC}/gcNewCapacityOutput1.awk
@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,3 +34,4 @@ verify_os
JSTAT="${TESTJAVA}/bin/jstat"

${JSTAT} ${COMMON_JSTAT_FLAGS} -gcnew 0 2>&1 | awk -f ${TESTSRC}/gcNewOutput1.awk
${JSTAT} ${COMMON_JSTAT_FLAGS} -J-XX:+UseParallelGC -gcnew 0 2>&1 | awk -f ${TESTSRC}/gcNewOutput1.awk
@@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -34,3 +34,4 @@ verify_os
JSTAT="${TESTJAVA}/bin/jstat"

${JSTAT} ${COMMON_JSTAT_FLAGS} -gcoldcapacity 0 2>&1 | awk -f ${TESTSRC}/gcOldCapacityOutput1.awk
${JSTAT} ${COMMON_JSTAT_FLAGS} -J-XX:+UseParallelGC -gcoldcapacity 0 2>&1 | awk -f ${TESTSRC}/gcOldCapacityOutput1.awk

0 comments on commit 51b7c76

Please sign in to comment.