--- old/src/share/vm/gc_implementation/g1/heapRegion.hpp 2011-10-19 08:35:06.776259000 +0200 +++ new/src/share/vm/gc_implementation/g1/heapRegion.hpp 2011-10-19 08:35:06.338234000 +0200 @@ -431,6 +431,16 @@ return _humongous_start_region; } + // Same as Space::is_in_reserved, but will use the actual size of a humongous start + // region rather than the end of the humongous object. + bool is_in_reserved_raw(const void* p) const { + if (startsHumongous()) { + return _bottom <= p && p < _orig_end; + } else { + return Space::is_in_reserved(p); + } + } + // Makes the current region be a "starts humongous" region, i.e., // the first region in a series of one or more contiguous regions // that will contain a single "humongous" object. The two parameters --- old/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp 2011-10-19 08:35:14.700712300 +0200 +++ new/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp 2011-10-19 08:35:14.234685600 +0200 @@ -143,7 +143,7 @@ // If the test below fails, then this table was reused concurrently // with this operation. This is OK, since the old table was coarsened, // and adding a bit to the new table is never incorrect. - if (loc_hr->is_in_reserved(from)) { + if (loc_hr->is_in_reserved_raw(from)) { size_t hw_offset = pointer_delta((HeapWord*)from, loc_hr->bottom()); CardIdx_t from_card = (CardIdx_t) hw_offset >> (CardTableModRefBS::card_shift - LogHeapWordSize);