< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.cpp

Print this page
rev 9402 : dihop-changes
rev 9404 : [mq]: erik-jmasa-review

@@ -5633,10 +5633,18 @@
       cur->uninstall_surv_rate_group();
       if (cur->is_young()) {
         cur->set_young_index_in_cset(-1);
       }
       cur->set_evacuation_failed(false);
+      // When moving a young gen region to old gen, we "allocate" that whole region
+      // there. This is in addition to any already evacuated objects. Notify the
+      // policy about that.
+      // Old gen regions do not cause an additional allocation: both the objects
+      // still in the region and the ones already moved are accounted for elsewhere.
+      if (cur->is_young()) {
+        policy->add_last_old_allocated_bytes(HeapRegion::GrainBytes);
+      }
       // The region is now considered to be old.
       cur->set_old();
       // Do some allocation statistics accounting. Regions that failed evacuation
       // are always made old, so there is no need to update anything in the young
       // gen statistics, but we need to update old gen statistics.
< prev index next >