--- old/src/hotspot/share/gc/g1/collectionSetChooser.cpp 2018-11-19 14:03:34.682689000 -0800 +++ new/src/hotspot/share/gc/g1/collectionSetChooser.cpp 2018-11-19 14:03:33.710506600 -0800 @@ -49,6 +49,14 @@ return -1; } + if (hr1->is_premature_old() && !hr2->is_premature_old()) { + return -1; + } + + if (hr2->is_premature_old() && !hr1->is_premature_old()) { + return 1; + } + double gc_eff1 = hr1->gc_efficiency(); double gc_eff2 = hr2->gc_efficiency(); if (gc_eff1 > gc_eff2) { @@ -283,7 +291,7 @@ bool CollectionSetChooser::should_add(HeapRegion* hr) const { return !hr->is_young() && !hr->is_pinned() && - region_occupancy_low_enough_for_evac(hr->live_bytes()) && + (hr->is_premature_old() || region_occupancy_low_enough_for_evac(hr->live_bytes())) && hr->rem_set()->is_complete(); }