changeset 59567:a4308cbd8dfb

8245707: Increase Metaspace reserve alignment Reviewed-by: iklam, coleenp
author stuefe
date Tue, 02 Jun 2020 21:04:13 +0200
parents a2c20ab148ab
children c42cc6946652
files src/hotspot/share/memory/metaspace.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/memory/metaspace.cpp	Tue Jun 02 15:01:45 2020 -0400
+++ b/src/hotspot/share/memory/metaspace.cpp	Tue Jun 02 21:04:13 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