hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
changeset 35507 aa2affc60a2f
parent 35492 c8c0273e6b91
child 35532 929dfc251a28
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Jan 15 16:03:46 2016 +0400
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Jan 15 10:34:52 2016 -0800
@@ -3535,6 +3535,16 @@
   cl.flush_rem_set_entries();
 }
 
+class VerifyRegionRemSetClosure : public HeapRegionClosure {
+  public:
+    bool doHeapRegion(HeapRegion* hr) {
+      if (!hr->is_archive() && !hr->is_continues_humongous()) {
+        hr->verify_rem_set();
+      }
+      return false;
+    }
+};
+
 #ifdef ASSERT
 class VerifyCSetClosure: public HeapRegionClosure {
 public:
@@ -3724,6 +3734,12 @@
       increment_total_collections(false /* full gc */);
       increment_gc_time_stamp();
 
+      if (VerifyRememberedSets) {
+        log_info(gc, verify)("[Verifying RemSets before GC]");
+        VerifyRegionRemSetClosure v_cl;
+        heap_region_iterate(&v_cl);
+      }
+
       verify_before_gc();
 
       check_bitmaps("GC Start");
@@ -3928,6 +3944,12 @@
         // scanning cards (see CR 7039627).
         increment_gc_time_stamp();
 
+        if (VerifyRememberedSets) {
+          log_info(gc, verify)("[Verifying RemSets after GC]");
+          VerifyRegionRemSetClosure v_cl;
+          heap_region_iterate(&v_cl);
+        }
+
         verify_after_gc();
         check_bitmaps("GC End");