--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2015-11-16 16:53:01.863324036 +0100 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2015-11-16 16:53:01.774321359 +0100 @@ -5635,6 +5635,14 @@ 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