--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Jan 27 11:57:45 2016 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Jan 27 11:57:43 2016 @@ -3839,6 +3839,16 @@ _surviving_young_words = NULL; } +class VerifyRegionRemSetClosure : public HeapRegionClosure { + public: + bool doHeapRegion(HeapRegion* hr) { + if (!hr->continuesHumongous()) { + hr->verify_rem_set(); + } + return false; + } +}; + #ifdef ASSERT class VerifyCSetClosure: public HeapRegionClosure { public: @@ -4015,6 +4025,14 @@ increment_total_collections(false /* full gc */); increment_gc_time_stamp(); + if (VerifyRememberedSets) { + if (PrintGCDetails) { + gclog_or_tty->print_cr("[Verifying RemSets before GC]"); + } + VerifyRegionRemSetClosure v_cl; + heap_region_iterate(&v_cl); + } + verify_before_gc(); check_bitmaps("GC Start"); @@ -4246,6 +4264,14 @@ // scanning cards (see CR 7039627). increment_gc_time_stamp(); + if (VerifyRememberedSets) { + if (PrintGCDetails) { + gclog_or_tty->print_cr("[Verifying RemSets after GC]"); + } + VerifyRegionRemSetClosure v_cl; + heap_region_iterate(&v_cl); + } + verify_after_gc(); check_bitmaps("GC End");