diff src/share/vm/services/virtualMemoryTracker.cpp @ 20365:3adc0e278f49

8055061: assert at share/vm/services/virtualMemoryTracker.cpp:332 Error: ShouldNotReachHere() when running NMT tests Summary: Handled CDS mapping region and added test for the scenario Reviewed-by: coleenp, ctornqvi
author zgu
date Tue, 19 Aug 2014 09:05:55 -0400
parents c6211b707068
children 417e3b8d04c5
line wrap: on
line diff
--- a/src/share/vm/services/virtualMemoryTracker.cpp	Tue Aug 19 08:34:25 2014 -0400
+++ b/src/share/vm/services/virtualMemoryTracker.cpp	Tue Aug 19 09:05:55 2014 -0400
@@ -337,10 +337,18 @@
 
         *reserved_rgn = rgn;
         return true;
-      } else {
-        ShouldNotReachHere();
-        return false;
       }
+
+      // CDS mapping region.
+      // CDS reserves the whole region for mapping CDS archive, then maps each section into the region.
+      // NMT reports CDS as a whole.
+      if (reserved_rgn->flag() == mtClassShared) {
+        assert(reserved_rgn->contain_region(base_addr, size), "Reserved CDS region should contain this mapping region");
+        return true;
+      }
+
+      ShouldNotReachHere();
+      return false;
     }
   }
 }