diff src/share/vm/memory/compactingPermGenGen.cpp @ 1051:26f1542097f1

6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp Summary: Allow iteration over the shared spaces when using CDS, repealing previous proscription. Deferred further required CDS-related cleanups of perm gen to CR 6897789. Reviewed-by: phh, jmasa
author ysr
date Tue, 03 Nov 2009 16:43:16 -0800
parents 5251a9cd8eb8
children c18cbe5936b8
line wrap: on
line diff
--- a/src/share/vm/memory/compactingPermGenGen.cpp	Fri Oct 30 13:31:11 2009 -0400
+++ b/src/share/vm/memory/compactingPermGenGen.cpp	Tue Nov 03 16:43:16 2009 -0800
@@ -352,15 +352,19 @@
 }
 
 
+// Do not use in time-critical operations due to the possibility of paging
+// in otherwise untouched or previously unread portions of the perm gen,
+// for instance, the shared spaces. NOTE: Because CompactingPermGenGen
+// derives from OneContigSpaceCardGeneration which is supposed to have a
+// single space, and does not override its object_iterate() method,
+// object iteration via that interface does not look at the objects in
+// the shared spaces when using CDS. This should be fixed; see CR 6897798.
 void CompactingPermGenGen::space_iterate(SpaceClosure* blk, bool usedOnly) {
   OneContigSpaceCardGeneration::space_iterate(blk, usedOnly);
   if (spec()->enable_shared_spaces()) {
-#ifdef PRODUCT
     // Making the rw_space walkable will page in the entire space, and
-    // is to be avoided. However, this is required for Verify options.
-    ShouldNotReachHere();
-#endif
-
+    // is to be avoided in the case of time-critical operations.
+    // However, this is required for Verify and heap dump operations.
     blk->do_space(ro_space());
     blk->do_space(rw_space());
   }