commit granule size must not be smaller than native page size stuefe-new-metaspace-branch
authorstuefe
Tue, 10 Sep 2019 12:53:00 +0200
branchstuefe-new-metaspace-branch
changeset 58067 b83deb51ea70
parent 58063 bdf136b8ae0e
child 58069 ba98d1dccf30
commit granule size must not be smaller than native page size
src/hotspot/share/memory/metaspace/settings.cpp
--- a/src/hotspot/share/memory/metaspace/settings.cpp	Tue Sep 10 09:24:05 2019 +0200
+++ b/src/hotspot/share/memory/metaspace/settings.cpp	Tue Sep 10 12:53:00 2019 +0200
@@ -61,7 +61,7 @@
 
     log_info(metaspace)("Initialized with strategy: no reclaim.");
 
-    _commit_granule_bytes = 64 * K;
+    _commit_granule_bytes = MAX2((size_t)os::vm_page_size(), 64 * K);
     _commit_granule_words = _commit_granule_bytes / BytesPerWord;
 
     _newborn_root_chunks_are_fully_committed = true;
@@ -83,7 +83,7 @@
 
     // Set the granule size rather small; may increase
     // mapping fragmentation but also increase chance to uncommit.
-    _commit_granule_bytes = 16 * K;
+    _commit_granule_bytes = MAX2((size_t)os::vm_page_size(), 16 * K);
     _commit_granule_words = _commit_granule_bytes / BytesPerWord;
 
     _newborn_root_chunks_are_fully_committed = false;
@@ -106,7 +106,7 @@
 
     log_info(metaspace)("Initialized with strategy: balanced reclaim.");
 
-    _commit_granule_bytes = 64 * K;
+    _commit_granule_bytes = MAX2((size_t)os::vm_page_size(), 64 * K);
     _commit_granule_words = _commit_granule_bytes / BytesPerWord;
 
     _newborn_root_chunks_are_fully_committed = false;