src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
changeset 59062 6530de931b8e
parent 59061 df6f2350edfa
child 59198 92c98aa0f801
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Wed Nov 13 10:49:32 2019 -0800
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Wed Nov 13 10:51:41 2019 -0800
@@ -57,7 +57,9 @@
     _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.
@@ -79,6 +81,8 @@
   _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.
@@ -92,6 +96,7 @@
   for (uint i = 0; i < length; i++) {
     surviving_young_words[i] += _surviving_young_words[i];
   }
+  flush_numa_stats();
 }
 
 G1ParScanThreadState::~G1ParScanThreadState() {
@@ -99,6 +104,7 @@
   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 {
@@ -248,6 +254,8 @@
         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);