# HG changeset patch # User stuefe # Date 1590558926 -7200 # Wed May 27 07:55:26 2020 +0200 # Node ID e8a52daf510e76fc2dc943bdeae6080bc092cc7a # Parent ce51df3ee4223b2f6f6d180283de7e4e276a8cdc [mq]: 8245707-Increase-Metaspace-reserve-alignment diff -r ce51df3ee422 -r e8a52daf510e src/hotspot/share/memory/metaspace.cpp --- a/src/hotspot/share/memory/metaspace.cpp Wed May 27 03:21:15 2020 +0000 +++ b/src/hotspot/share/memory/metaspace.cpp Wed May 27 07:55:26 2020 +0200 @@ -1077,6 +1077,13 @@ _commit_alignment = page_size; _reserve_alignment = MAX2(page_size, (size_t)os::vm_allocation_granularity()); + // The upcoming Metaspace rewrite will impose a higher alignment granularity. + // To prepare for that and to catch/prevent any misuse of Metaspace alignment + // which may creep in, up the alignment a bit. + if (_reserve_alignment == 4 * K) { + _reserve_alignment *= 4; + } + // Do not use FLAG_SET_ERGO to update MaxMetaspaceSize, since this will // override if MaxMetaspaceSize was set on the command line or not. // This information is needed later to conform to the specification of the