diff src/share/vm/memory/universe.cpp @ 8741:eac371996b44

8001049: VM crashes when running with large -Xms and not specifying ObjectAlignmentInBytes Summary: Take the initial heap size into account when checking the heap size for compressed oops Reviewed-by: jmasa, kvn, hseigel, ctornqvi
author brutisso
date Tue, 12 Mar 2013 08:33:57 +0100
parents 3c9bc17b9403
children dbd5837b342f
line wrap: on
line diff
--- a/src/share/vm/memory/universe.cpp	Mon Mar 11 02:24:01 2013 -0700
+++ b/src/share/vm/memory/universe.cpp	Tue Mar 12 08:33:57 2013 +0100
@@ -885,6 +885,8 @@
   // the actual alignment depends on its size.
   Universe::set_class_metaspace_size(align_size_up(ClassMetaspaceSize, alignment));
   size_t total_reserved = align_size_up(heap_size + Universe::class_metaspace_size(), alignment);
+  assert(!UseCompressedOops || (total_reserved <= (OopEncodingHeapMax - os::vm_page_size())),
+      "heap size is too big for compressed oops");
   char* addr = Universe::preferred_heap_base(total_reserved, Universe::UnscaledNarrowOop);
 
   ReservedHeapSpace total_rs(total_reserved, alignment, UseLargePages, addr);