src/hotspot/share/gc/g1/g1MonitoringSupport.cpp
changeset 48116 8a5e8cd321d9
parent 47216 71c04702a3d5
child 49377 ecd91135d645
equal deleted inserted replaced
48115:d8ec0640616c 48116:8a5e8cd321d9
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "gc/g1/g1CollectedHeap.inline.hpp"
    26 #include "gc/g1/g1CollectedHeap.inline.hpp"
    27 #include "gc/g1/g1MonitoringSupport.hpp"
    27 #include "gc/g1/g1MonitoringSupport.hpp"
    28 #include "gc/g1/g1Policy.hpp"
    28 #include "gc/g1/g1Policy.hpp"
       
    29 #include "gc/shared/hSpaceCounters.hpp"
    29 
    30 
    30 G1GenerationCounters::G1GenerationCounters(G1MonitoringSupport* g1mm,
    31 G1GenerationCounters::G1GenerationCounters(G1MonitoringSupport* g1mm,
    31                                            const char* name,
    32                                            const char* name,
    32                                            int ordinal, int spaces,
    33                                            int ordinal, int spaces,
    33                                            size_t min_capacity,
    34                                            size_t min_capacity,
   126   _old_collection_counters = new G1OldGenerationCounters(this, "old");
   127   _old_collection_counters = new G1OldGenerationCounters(this, "old");
   127 
   128 
   128   //  name  "generation.1.space.0"
   129   //  name  "generation.1.space.0"
   129   // Counters are created from maxCapacity, capacity, initCapacity,
   130   // Counters are created from maxCapacity, capacity, initCapacity,
   130   // and used.
   131   // and used.
   131   _old_space_counters = new HSpaceCounters("space", 0 /* ordinal */,
   132   _old_space_counters = new HSpaceCounters(_old_collection_counters->name_space(),
       
   133     "space", 0 /* ordinal */,
   132     pad_capacity(overall_reserved()) /* max_capacity */,
   134     pad_capacity(overall_reserved()) /* max_capacity */,
   133     pad_capacity(old_space_committed()) /* init_capacity */,
   135     pad_capacity(old_space_committed()) /* init_capacity */);
   134    _old_collection_counters);
       
   135 
   136 
   136   //   Young collection set
   137   //   Young collection set
   137   //  name "generation.0".  This is logically the young generation.
   138   //  name "generation.0".  This is logically the young generation.
   138   //  The "0, 3" are parameters for the n-th generation (=0) with 3 spaces.
   139   //  The "0, 3" are parameters for the n-th generation (=0) with 3 spaces.
   139   // See  _old_collection_counters for additional counters
   140   // See  _old_collection_counters for additional counters
   140   _young_collection_counters = new G1YoungGenerationCounters(this, "young");
   141   _young_collection_counters = new G1YoungGenerationCounters(this, "young");
   141 
   142 
       
   143   const char* young_collection_name_space = _young_collection_counters->name_space();
       
   144 
   142   //  name "generation.0.space.0"
   145   //  name "generation.0.space.0"
   143   // See _old_space_counters for additional counters
   146   // See _old_space_counters for additional counters
   144   _eden_counters = new HSpaceCounters("eden", 0 /* ordinal */,
   147   _eden_counters = new HSpaceCounters(young_collection_name_space,
       
   148     "eden", 0 /* ordinal */,
   145     pad_capacity(overall_reserved()) /* max_capacity */,
   149     pad_capacity(overall_reserved()) /* max_capacity */,
   146     pad_capacity(eden_space_committed()) /* init_capacity */,
   150     pad_capacity(eden_space_committed()) /* init_capacity */);
   147     _young_collection_counters);
       
   148 
   151 
   149   //  name "generation.0.space.1"
   152   //  name "generation.0.space.1"
   150   // See _old_space_counters for additional counters
   153   // See _old_space_counters for additional counters
   151   // Set the arguments to indicate that this survivor space is not used.
   154   // Set the arguments to indicate that this survivor space is not used.
   152   _from_counters = new HSpaceCounters("s0", 1 /* ordinal */,
   155   _from_counters = new HSpaceCounters(young_collection_name_space,
       
   156     "s0", 1 /* ordinal */,
   153     pad_capacity(0) /* max_capacity */,
   157     pad_capacity(0) /* max_capacity */,
   154     pad_capacity(0) /* init_capacity */,
   158     pad_capacity(0) /* init_capacity */);
   155     _young_collection_counters);
       
   156 
   159 
   157   //  name "generation.0.space.2"
   160   //  name "generation.0.space.2"
   158   // See _old_space_counters for additional counters
   161   // See _old_space_counters for additional counters
   159   _to_counters = new HSpaceCounters("s1", 2 /* ordinal */,
   162   _to_counters = new HSpaceCounters(young_collection_name_space,
       
   163     "s1", 2 /* ordinal */,
   160     pad_capacity(overall_reserved()) /* max_capacity */,
   164     pad_capacity(overall_reserved()) /* max_capacity */,
   161     pad_capacity(survivor_space_committed()) /* init_capacity */,
   165     pad_capacity(survivor_space_committed()) /* init_capacity */);
   162     _young_collection_counters);
       
   163 
   166 
   164   if (UsePerfData) {
   167   if (UsePerfData) {
   165     // Given that this survivor space is not used, we update it here
   168     // Given that this survivor space is not used, we update it here
   166     // once to reflect that its used space is 0 so that we don't have to
   169     // once to reflect that its used space is 0 so that we don't have to
   167     // worry about updating it again later.
   170     // worry about updating it again later.