7140866: assert(covered) failed: Card for end of new region not committed
authordlong
Wed, 15 Feb 2012 00:51:07 -0500
changeset 11751 c80672b25b67
parent 11731 94a9493c5f04
child 11752 abc5aecaaf0f
child 11884 ba36e55cbe3a
7140866: assert(covered) failed: Card for end of new region not committed Summary: resize covered region only after successfully mapping shared archive Reviewed-by: brutisso, ysr Contributed-by: dean.long@oracle.com
hotspot/src/share/vm/memory/compactingPermGenGen.cpp
--- a/hotspot/src/share/vm/memory/compactingPermGenGen.cpp	Mon Feb 06 10:57:49 2012 -0500
+++ b/hotspot/src/share/vm/memory/compactingPermGenGen.cpp	Wed Feb 15 00:51:07 2012 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -240,9 +240,6 @@
     if (_ro_space == NULL || _rw_space == NULL)
       vm_exit_during_initialization("Could not allocate a shared space");
 
-    // Cover both shared spaces entirely with cards.
-    _rs->resize_covered_region(MemRegion(readonly_bottom, readwrite_end));
-
     if (UseSharedSpaces) {
 
       // Map in the regions in the shared file.
@@ -279,10 +276,14 @@
         delete _rw_space;
         _rw_space = NULL;
         shared_end = (HeapWord*)(rs.base() + rs.size());
-        _rs->resize_covered_region(MemRegion(shared_bottom, shared_bottom));
       }
     }
 
+    if (spec()->enable_shared_spaces()) {
+      // Cover both shared spaces entirely with cards.
+      _rs->resize_covered_region(MemRegion(readonly_bottom, readwrite_end));
+    }
+
     // Reserved region includes shared spaces for oop.is_in_reserved().
     _reserved.set_end(shared_end);