--- old/src/share/vm/memory/universe.cpp 2013-06-04 17:03:28.579740767 +0200 +++ new/src/share/vm/memory/universe.cpp 2013-06-04 17:03:28.407740763 +0200 @@ -876,12 +876,13 @@ // Reserve the Java heap, which is now the same for all GCs. ReservedSpace Universe::reserve_heap(size_t heap_size, size_t alignment) { + assert(alignment <= Arguments::max_heap_alignment(), "actual alignment must be within maximum heap alignment"); // Add in the class metaspace area so the classes in the headers can // be compressed the same as instances. // Need to round class space size up because it's below the heap and // 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); + size_t total_reserved = align_size_up(heap_size, alignment) + Universe::class_metaspace_size(); 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);