hotspot/src/share/vm/gc/g1/g1Policy.cpp
changeset 38010 51fe205359f8
parent 37985 539c597ee0fa
child 38013 89b93eb018fb
--- a/hotspot/src/share/vm/gc/g1/g1Policy.cpp	Thu Apr 21 09:08:33 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1Policy.cpp	Thu Apr 21 10:18:50 2016 +0200
@@ -52,6 +52,7 @@
 
   _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
@@ -92,8 +93,6 @@
 
   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 {
@@ -970,9 +969,8 @@
   // 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) {