CRR (S/M): 7075646: G1: fix inconsistencies in the monitoring data

Tony Printezis tony.printezis at oracle.com
Wed Aug 10 19:34:53 UTC 2011


Hi all,

I would like a couple of code reviews for some fixes in the G1 
monitoring code:

http://cr.openjdk.java.net/~tonyp/7075646/webrev.0/

The main motivation behind these changes is that G1's jstat output has 
inconsistencies and has been causing a few test failures. Here's a quick 
summary of the changes:

- Reworked the way the capacities of the various spaces are calculated 
so that only the eden space used counter needs to be updated when a new 
eden region is allocated.
- Now the values of the various sizes that need to be reported are 
calculated synchronously in all the appropriate places in the code and 
stored so that they do not need to be recalculated every time they are 
required.
- The jstat counters for the young / old gen capacity are now correctly 
updated.
- We ensure that when we are reporting a capacity to jstat we 
artficially pad it so that it's never 0 (as jstat does not handle 0 
capacities gracefully).

I attached a file that has before / after output comparisons, along with 
some commentary, for the various jstat GC parameters.

Tony

-------------- next part --------------
----------

-gc

 S0C    S1C    S0U    S1U      EC       EU        OC         OU       PC     PU    YGC     YGCT    FGC    FGCT     GCT   

BEFORE:

 0.0   1024.0  0.0    0.0    9216.0   9216.0   30720.0    11566.9   16384.0 2684.0      7    0.209   1      0.019    0.227
 0.0   1024.0  0.0   1024.0  3072.0   3072.0   30720.0    12182.3   16384.0 2686.9      8    0.250   1      0.019    0.268

AFTER:
 
 0.0    0.0    0.0    0.0    6144.0   3072.0   26624.0    11294.3   16384.0 2646.3      7    0.163   1      0.018    0.181
 0.0    0.0    0.0    0.0   10240.0    0.0     22528.0    12153.0   16384.0 2648.5      8    0.196   1      0.018    0.214

COMMENTS: EC is now calculated differently (i.e., it's not always == EU) OC is also calculated differently (it's smaller as the Eden capacity is not larger).

----------

-gccapacity

BEFORE:

 NGCMN    NGCMX     NGC     S0C   S1C       EC      OGCMN      OGCMX       OGC         OC      PGCMN    PGCMX     PGC       PC     YGC    FGC 

     0.0      0.0      0.0    0.0 1024.0   4096.0    32768.0    65536.0    32768.0    30720.0  16384.0  65536.0  16384.0  16384.0      5     1
     0.0      0.0      0.0    0.0 1024.0   1024.0    32768.0    65536.0    32768.0    30720.0  16384.0  65536.0  16384.0  16384.0      6     1

AFTER:

     0.0  65536.0   6144.0    0.0    0.0   6144.0        0.0    65536.0    26624.0    26624.0  16384.0  65536.0  16384.0  16384.0      5     1
     0.0  65536.0   6144.0    0.0    0.0   6144.0        0.0    65536.0    26624.0    26624.0  16384.0  65536.0  16384.0  16384.0      6     1

COMMENTS: The minimum generation capacities (NGCMN and OGCMN) are now set to the same value, i.e., 0. The maximum generation capacities (NGCMX and OGCMX) are also set to the same value which is the maximum heap capacity. EC and OC are also calculated differently.

----------
 
-gccause

  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT    LGCC                 GCC                 

BEFORE:

     �   0.00 100.00  29.16  15.93      4    0.137     1    0.017    0.154 G1 Evacuation Pause  No GC               
     �   0.00 100.00  29.16  16.00      5    0.137     1    0.017    0.154 No GC                G1 Evacuation Pause 

AFTER:

  0.00   0.00  42.86  33.36  15.93      4    0.091     1    0.020    0.111 G1 Evacuation Pause  No GC               
  0.00   0.00  85.71  33.36  15.94      5    0.091     1    0.020    0.111 No GC                G1 Evacuation Pause 

COMMENTS: Fixed the division-by-zero bug that was causing the missing values in the first column. The Eden is not shown to always be full given that its capacity is calculated differently.

----------

-gcnew

 S0C    S1C    S0U    S1U   TT MTT  DSS      EC       EU     YGC     YGCT  

BEFORE:

   0.0 1024.0    0.0 1024.0  1  15    0.0   6144.0   6144.0      3    0.084
   0.0 1024.0    0.0    0.0 15  15    0.0   1024.0   1024.0      4    0.116

AFTER:

   0.0 1024.0    0.0 1024.0  1  15    0.0   7168.0   5120.0      3    0.088
   0.0    0.0    0.0    0.0 15  15    0.0   7168.0      0.0      4    0.136

COMMENTS: EC is now calculated differently.

----------

-gcnewcapacity


  NGCMN      NGCMX       NGC      S0CMX     S0C     S1CMX     S1C       ECMX        EC      YGC   FGC 

BEFORE:

       0.0        0.0        0.0      0.0      0.0  65536.0   1024.0    65536.0     4096.0     4     1
       0.0        0.0        0.0      0.0      0.0  65536.0   1024.0    65536.0     6144.0     5     1

AFTER:

       0.0    65536.0     7168.0      0.0      0.0  65536.0      0.0    65536.0     7168.0     4     1
       0.0    65536.0     6144.0      0.0      0.0  65536.0      0.0    65536.0     6144.0     5     1

COMMENTS: NGCMX is now set to the max heap capacity. NGC is now updated correctly. EC is now calculated differently.

----------

-gcold

   PC       PU        OC          OU       YGC    FGC    FGCT     GCT   

BEFORE:

 16384.0   2636.8     30720.0     10827.7      6     1    0.020    0.214
 16384.0   2650.2     30720.0     11577.3      7     1    0.020    0.242

AFTER:

 16384.0   2637.8     26624.0     10953.0      6     1    0.023    0.321
 16384.0   2644.4     22528.0     11712.2      7     1    0.023    0.336

COMMENTS: OC is now calculated differently (it's smaller as the Eden capacity is now larger).

----------

-gcoldcapacity

   OGCMN       OGCMX        OGC         OC       YGC   FGC    FGCT     GCT   

BEFORE:

    32768.0     65536.0     32768.0     30720.0     8     2    0.072    0.350
    32768.0     65536.0     32768.0     30720.0     9     2    0.072    0.420

AFTER:

        0.0     65536.0     22528.0     22528.0     8     1    0.018    0.218
        0.0     65536.0     22528.0     22528.0     9     1    0.018    0.253

COMMENTS: OGCMN is now set to 0, OGC is now updated correctly and matches OC, OC is now calculated differently (it's smaller as the Eden capacity is now larger).

----------

-gcutil

  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   

BEFORE:

     � 100.00 100.00  40.87  16.38      8    0.308     1    0.017    0.325
     �   0.00 100.00   2.71  16.40      8    0.308     2    0.058    0.365

AFTER:

  0.00   0.00  80.00  53.93  16.40      8    0.290     1    0.021    0.311
  0.00   0.00   6.25   5.08  16.40      8    0.290     2    0.066    0.356

COMMENTS: Fixed the division-by-zero bug that was causing the missing values in the first column. The Eden capacity is calculated differently so the eden is not shown to always be 100% full.

----------


More information about the hotspot-gc-dev mailing list