< prev index next >

src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp

Print this page
rev 7854 : imported patch 8027962-per-phase-timing-measurements-for-strong-roots-processing

@@ -84,10 +84,12 @@
 };
 
 G1CollectorPolicy::G1CollectorPolicy() :
   _parallel_gc_threads(ParallelGCThreads),
 
+  _phase_times(NULL),
+
   _recent_gc_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)),
   _stop_world_start(0.0),
 
   _concurrent_mark_remark_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)),
   _concurrent_mark_cleanup_times_ms(new TruncatedSeq(NumPrevPausesForHeuristics)),

@@ -206,12 +208,10 @@
   }
 
   _recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime());
   _prev_collection_pause_end_ms = os::elapsedTime() * 1000.0;
 
-  _phase_times = new G1GCPhaseTimes(_parallel_gc_threads);
-
   int index = MIN2(_parallel_gc_threads - 1, 7);
 
   _rs_length_diff_seq->add(rs_length_diff_defaults[index]);
   _cost_per_card_ms_seq->add(cost_per_card_ms_defaults[index]);
   _young_cards_per_entry_ratio_seq->add(

@@ -433,10 +433,11 @@
   recalculate_min_max_young_length(new_number_of_heap_regions, &_min_desired_young_length,
           &_max_desired_young_length);
 }
 
 void G1CollectorPolicy::init() {
+  _phase_times = new G1GCPhaseTimes(_parallel_gc_threads, G1Log::finest() ? G1CollectedHeap::num_ext_root_tasks() : 0);
   // Set aside an initial future to_space.
   _g1 = G1CollectedHeap::heap();
 
   assert(Heap_lock->owned_by_self(), "Locking discipline.");
 
< prev index next >