From 664cf863adcd4cb3a1a456529acaf28385d4caec Mon Sep 17 00:00:00 2001 From: zgu Date: Fri, 15 Mar 2013 11:53:28 -0400 Subject: [PATCH] 8009614: nsk/split_verifier/stress/ifelse/ifelse002_30 fails with 'assert((size & (granularity - 1)) == 0) failed: size not aligned to os::vm_allocation_granularity() Summary: Align up vm allocation size to os defined granularity Reviewed-by: dholmes, coleenp --- src/share/vm/memory/metaspace.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/share/vm/memory/metaspace.cpp b/src/share/vm/memory/metaspace.cpp index 7853b3d51..2c4d86534 100644 --- a/src/share/vm/memory/metaspace.cpp +++ b/src/share/vm/memory/metaspace.cpp @@ -334,6 +334,9 @@ class VirtualSpaceNode : public CHeapObj { // byte_size is the size of the associated virtualspace. VirtualSpaceNode::VirtualSpaceNode(size_t byte_size) : _top(NULL), _next(NULL), _rs(0) { + // align up to vm allocation granularity + byte_size = align_size_up(byte_size, os::vm_allocation_granularity()); + // This allocates memory with mmap. For DumpSharedspaces, allocate the // space at low memory so that other shared images don't conflict. // This is the same address as memory needed for UseCompressedOops but -- GitLab