< prev index next >

src/share/vm/gc/g1/g1Policy.cpp

Print this page
rev 10911 : 8154467: Cleanup initialization of GCPolicyCounters
Reviewed-by:

@@ -50,10 +50,11 @@
   _max_survivor_regions(0),
   _survivors_age_table(true),
 
   _bytes_allocated_in_old_since_last_gc(0),
   _ihop_control(NULL),
+  _policy_counters(new GCPolicyCounters("GarbageFirst", 1, 3)),
   _initial_mark_to_mixed() {
 
   // SurvRateGroups below must be initialized after the predictor because they
   // indirectly use it through this object passed to their constructor.
   _short_lived_surv_rate_group =

@@ -90,12 +91,10 @@
   _g1 = G1CollectedHeap::heap();
   _collection_set = _g1->collection_set();
 
   assert(Heap_lock->owned_by_self(), "Locking discipline.");
 
-  _g1->collector_policy()->initialize_gc_policy_counters();
-
   if (adaptive_young_list_length()) {
     _young_list_fixed_length = 0;
   } else {
     _young_list_fixed_length = _young_gen_sizer.min_desired_young_length();
   }

@@ -968,13 +967,12 @@
                  (double) _young_list_target_length / (double) SurvivorRatio;
   // We use ceiling so that if max_survivor_regions_d is > 0.0 (but
   // smaller than 1.0) we'll get 1.
   _max_survivor_regions = (uint) ceil(max_survivor_regions_d);
 
-  GCPolicyCounters* counters = _g1->collector_policy()->counters();
   _tenuring_threshold = _survivors_age_table.compute_tenuring_threshold(
-        HeapRegion::GrainWords * _max_survivor_regions, counters);
+      HeapRegion::GrainWords * _max_survivor_regions, _policy_counters);
 }
 
 bool G1Policy::force_initial_mark_if_outside_cycle(GCCause::Cause gc_cause) {
   // We actually check whether we are marking here and not if we are in a
   // reclamation phase. This means that we will schedule a concurrent mark
< prev index next >