hotspot/src/share/vm/gc/g1/g1MonitoringSupport.cpp
changeset 38183 cb68e4923223
parent 37985 539c597ee0fa
equal deleted inserted replaced
38173:73d05e56ec86 38183:cb68e4923223
   175   // Recalculate all the sizes from scratch. We assume that this is
   175   // Recalculate all the sizes from scratch. We assume that this is
   176   // called at a point where no concurrent updates to the various
   176   // called at a point where no concurrent updates to the various
   177   // values we read here are possible (i.e., at a STW phase at the end
   177   // values we read here are possible (i.e., at a STW phase at the end
   178   // of a GC).
   178   // of a GC).
   179 
   179 
   180   uint young_list_length = g1->young_list()->length();
   180   uint young_list_length = g1->young_regions_count();
   181   uint survivor_list_length = g1->young_list()->survivor_length();
   181   uint survivor_list_length = g1->survivor_regions_count();
   182   assert(young_list_length >= survivor_list_length, "invariant");
   182   assert(young_list_length >= survivor_list_length, "invariant");
   183   uint eden_list_length = young_list_length - survivor_list_length;
   183   uint eden_list_length = young_list_length - survivor_list_length;
   184   // Max length includes any potential extensions to the young gen
   184   // Max length includes any potential extensions to the young gen
   185   // we'll do when the GC locker is active.
   185   // we'll do when the GC locker is active.
   186   uint young_list_max_length = g1->g1_policy()->young_list_max_length();
   186   uint young_list_max_length = g1->g1_policy()->young_list_max_length();
   235   G1CollectedHeap* g1 = g1h();
   235   G1CollectedHeap* g1 = g1h();
   236 
   236 
   237   // When a new eden region is allocated, only the eden_used size is
   237   // When a new eden region is allocated, only the eden_used size is
   238   // affected (since we have recalculated everything else at the last GC).
   238   // affected (since we have recalculated everything else at the last GC).
   239 
   239 
   240   uint young_region_num = g1h()->young_list()->length();
   240   uint young_region_num = g1h()->young_regions_count();
   241   if (young_region_num > _young_region_num) {
   241   if (young_region_num > _young_region_num) {
   242     uint diff = young_region_num - _young_region_num;
   242     uint diff = young_region_num - _young_region_num;
   243     _eden_used += (size_t) diff * HeapRegion::GrainBytes;
   243     _eden_used += (size_t) diff * HeapRegion::GrainBytes;
   244     // Somewhat defensive: cap the eden used size to make sure it
   244     // Somewhat defensive: cap the eden used size to make sure it
   245     // never exceeds the committed size.
   245     // never exceeds the committed size.