< prev index next >

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

Print this page
rev 57223 : imported patch 8225484-changes-to-survivor-calculation

@@ -54,10 +54,11 @@
     _worker_id(worker_id),
     _last_enqueued_card(SIZE_MAX),
     _stack_trim_upper_threshold(GCDrainStackTargetSize * 2 + 1),
     _stack_trim_lower_threshold(GCDrainStackTargetSize),
     _trim_ticks(),
+    _surviving_survivor_words(0),
     _surviving_young_words_base(NULL),
     _surviving_young_words(NULL),
     _surviving_words_length(young_cset_length + 1),
     _old_gen_is_full(false),
     _num_optional_regions(optional_cset_length),

@@ -91,10 +92,11 @@
   _rdcq.flush();
   flush_numa_stats();
   // Update allocation statistics.
   _plab_allocator->flush_and_retire_stats();
   _g1h->policy()->record_age_table(&_age_table);
+  _g1h->policy()->record_surviving_survivor_words(_surviving_survivor_words);
 
   size_t sum = 0;
   for (uint i = 0; i < _surviving_words_length; i++) {
     surviving_young_words[i] += _surviving_young_words[i];
     sum += _surviving_young_words[i];

@@ -286,12 +288,16 @@
   if (forward_ptr == NULL) {
     Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz);
 
     const uint young_index = from_region->young_index_in_cset();
 
-    assert((from_region->is_young() && young_index >  0) ||
-           (!from_region->is_young() && young_index == 0), "invariant" );
+    assert(from_region->is_young() ||
+           (!from_region->is_young() && young_index == 0), "region %u %s index %u", from_region->hrm_index(), from_region->get_short_type_str(), young_index);
+
+    if (age > 0 && region_attr.is_young()) {
+      _surviving_survivor_words += word_sz;
+    }
 
     if (dest_attr.is_young()) {
       if (age < markWord::max_age) {
         age++;
       }
< prev index next >