--- old/src/share/vm/gc_implementation/g1/heapRegion.cpp 2015-01-30 09:52:08.499054413 +0100 +++ new/src/share/vm/gc_implementation/g1/heapRegion.cpp 2015-01-30 09:52:08.429052379 +0100 @@ -420,7 +420,7 @@ oop obj; HeapWord* next = cur; - while (next <= start) { + do { cur = next; obj = oop(cur); if (obj->klass_or_null() == NULL) { @@ -429,13 +429,13 @@ } // Otherwise... next = cur + block_size(cur); - } + } while (next <= start); // If we finish the above loop...We have a parseable object that // begins on or before the start of the memory region, and ends // inside or spans the entire region. assert(cur <= start, "Loop postcondition"); - assert(obj->klass_or_null() != NULL, "Loop invariant"); + assert(obj->klass_or_null() != NULL, "Loop postcondition"); do { obj = oop(cur); @@ -453,7 +453,7 @@ // always need to iterate over them in full. // We only iterate over object arrays in full if they are completely contained // in the memory region. - if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur < end)) { + if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) { obj->oop_iterate(cl); } else { obj->oop_iterate(cl, mr);