--- old/src/share/vm/gc/g1/g1CollectionSet.cpp 2016-04-28 12:38:38.796612207 +0200 +++ new/src/share/vm/gc/g1/g1CollectionSet.cpp 2016-04-28 12:38:38.704608391 +0200 @@ -301,15 +301,17 @@ uint eden_region_length = young_list->eden_length(); init_region_lengths(eden_region_length, survivor_region_length); - HeapRegion* hr = young_list->first_survivor_region(); - while (hr != NULL) { + const GrowableArray* survivor_regions = _g1->young_list()->survivor_regions(); + for (GrowableArrayIterator it = survivor_regions->begin(); + it != survivor_regions->end(); + ++it) { + HeapRegion* hr = *it; assert(hr->is_survivor(), "badly formed young list"); // There is a convention that all the young regions in the CSet // are tagged as "eden", so we do this for the survivors here. We // use the special set_eden_pre_gc() as it doesn't check that the // region is free (which is not the case here). hr->set_eden_pre_gc(); - hr = hr->get_next_young_region(); } verify_young_cset_indices();