Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Commit 189289d

Browse files
committed
8262326: MaxMetaspaceSize does not have to be aligned to metaspace commit alignment
Reviewed-by: coleenp, iklam
1 parent d825198 commit 189289d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/hotspot/share/memory/metaspace.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,8 @@ void Metaspace::ergo_initialize() {
607607
// to commit for the Metaspace.
608608
// It is just a number; a limit we compare against before committing. It
609609
// does not have to be aligned to anything.
610-
// It gets used as compare value in class CommitLimiter.
611-
// It is set to max_uintx in globals.hpp by default, so by default it does
612-
// not limit anything.
610+
// It gets used as compare value before attempting to increase the metaspace
611+
// commit charge. It defaults to max_uintx (unlimited).
613612
//
614613
// CompressedClassSpaceSize is the size, in bytes, of the address range we
615614
// pre-reserve for the compressed class space (if we use class space).
@@ -626,8 +625,7 @@ void Metaspace::ergo_initialize() {
626625
// We still adjust CompressedClassSpaceSize to reasonable limits, mainly to
627626
// save on reserved space, and to make ergnonomics less confusing.
628627

629-
// (aligned just for cleanliness:)
630-
MaxMetaspaceSize = MAX2(align_down(MaxMetaspaceSize, commit_alignment()), commit_alignment());
628+
MaxMetaspaceSize = MAX2(MaxMetaspaceSize, commit_alignment());
631629

632630
if (UseCompressedClassPointers) {
633631
// Let CCS size not be larger than 80% of MaxMetaspaceSize. Note that is

src/hotspot/share/memory/metaspace/metaspaceReporter.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ static void print_vs(outputStream* out, size_t scale) {
9696

9797
static void print_settings(outputStream* out, size_t scale) {
9898
out->print("MaxMetaspaceSize: ");
99-
// See Metaspace::ergo_initialize() for how MaxMetaspaceSize is rounded
100-
if (MaxMetaspaceSize >= align_down(max_uintx, Metaspace::commit_alignment())) {
101-
// aka "very big". Default is max_uintx, but due to rounding in arg parsing the real
102-
// value is smaller.
99+
if (MaxMetaspaceSize == max_uintx) {
103100
out->print("unlimited");
104101
} else {
105102
print_human_readable_size(out, MaxMetaspaceSize, scale);

0 commit comments

Comments
 (0)