--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-07-10 11:11:03.365975192 +0200 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-07-10 11:11:03.280972733 +0200 @@ -2953,13 +2953,11 @@ HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const { // We're not using an iterator given that it will wrap around when // it reaches the last region and this is not what we want here. - uint index = from->hrs_index() + 1; - while (index < n_regions()) { + for (uint index = from->hrs_index() + 1; index < n_regions(); index++) { HeapRegion* hr = region_at(index); if (!hr->isHumongous()) { return hr; } - index += 1; } return NULL; } @@ -6613,9 +6611,8 @@ } else if (!_free_list_only) { assert(!r->is_young(), "we should not come across young regions"); - if (r->startsHumongous()) { + if (r->isHumongous()) { // We ignore humongous regions, we left the humongous set unchanged - } else if (r->continuesHumongous()) { } else { // The rest should be old, add them to the old set _old_set->add(r);