< prev index next >

src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

Print this page
rev 56830 : imported patch 8220311.sur.2
rev 56832 : imported patch 8220311.sur.4
rev 56834 : imported patch 8220312.stat.2
rev 56835 : imported patch 8220312.stat.3
rev 56836 : imported patch 8220312.stat.4

@@ -55,11 +55,13 @@
     _last_enqueued_card(SIZE_MAX),
     _stack_trim_upper_threshold(GCDrainStackTargetSize * 2 + 1),
     _stack_trim_lower_threshold(GCDrainStackTargetSize),
     _trim_ticks(),
     _old_gen_is_full(false),
-    _num_optional_regions(optional_cset_length)
+    _num_optional_regions(optional_cset_length),
+    _numa(g1h->numa()),
+    _obj_alloc_stat(NULL)
 {
   // We allocate number of young gen regions in the collection set plus one
   // entries, since entry 0 keeps track of surviving bytes for non-young regions.
   // We also add a few elements at the beginning and at the end in
   // an attempt to eliminate cache contention

@@ -77,10 +79,12 @@
   _dest[G1HeapRegionAttr::Old]   = G1HeapRegionAttr::Old;
 
   _closures = G1EvacuationRootClosures::create_root_closures(this, _g1h);
 
   _oops_into_optional_regions = new G1OopStarChunkedList[_num_optional_regions];
+
+  initialize_numa_stats();
 }
 
 // Pass locally gathered statistics to global state.
 void G1ParScanThreadState::flush(size_t* surviving_young_words) {
   _rdcq.flush();

@@ -90,17 +94,19 @@
 
   uint length = _g1h->collection_set()->young_region_length() + 1;
   for (uint i = 0; i < length; i++) {
     surviving_young_words[i] += _surviving_young_words[i];
   }
+  flush_numa_stats();
 }
 
 G1ParScanThreadState::~G1ParScanThreadState() {
   delete _plab_allocator;
   delete _closures;
   FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base);
   delete[] _oops_into_optional_regions;
+  FREE_C_HEAP_ARRAY(size_t, _obj_alloc_stat);
 }
 
 size_t G1ParScanThreadState::lab_waste_words() const {
   return _plab_allocator->waste();
 }

@@ -246,10 +252,12 @@
         // This will either forward-to-self, or detect that someone else has
         // installed a forwarding pointer.
         return handle_evacuation_failure_par(old, old_mark);
       }
     }
+    update_numa_stats(node_index);
+
     if (_g1h->_gc_tracer_stw->should_report_promotion_events()) {
       // The events are checked individually as part of the actual commit
       report_promotion_event(dest_attr, old, word_sz, age, obj_ptr, node_index);
     }
   }
< prev index next >