8286467: G1: Collection set pruning adds one region too many

Reviewed-by: tschatzl, ayang
This commit is contained in:
tqxia 2022-05-12 06:40:45 +00:00 committed by Thomas Schatzl
parent 82d257006d
commit 7567627f4a

@ -274,7 +274,7 @@ public:
virtual bool do_heap_region(HeapRegion* r) {
size_t const reclaimable = r->reclaimable_bytes();
if (_num_pruned > _max_pruned ||
if (_num_pruned >= _max_pruned ||
_cur_wasted + reclaimable > _max_wasted) {
return true;
}