8329223: Parallel: Parallel GC resizes heap even if -Xms = -Xmx
Reviewed-by: ayang, gli
This commit is contained in:
parent
3d11692bf3
commit
aca1e8365b
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -276,6 +276,9 @@ void GenArguments::initialize_size_info() {
|
||||
// and maximum heap size since no explicit flags exist
|
||||
// for setting the old generation maximum.
|
||||
MaxOldSize = MAX2(MaxHeapSize - max_young_size, GenAlignment);
|
||||
MinOldSize = MIN3(MaxOldSize,
|
||||
InitialHeapSize - initial_young_size,
|
||||
MinHeapSize - MinNewSize);
|
||||
|
||||
size_t initial_old_size = OldSize;
|
||||
|
||||
@ -287,9 +290,8 @@ void GenArguments::initialize_size_info() {
|
||||
// with the overall heap size). In either case make
|
||||
// the minimum, maximum and initial sizes consistent
|
||||
// with the young sizes and the overall heap sizes.
|
||||
MinOldSize = GenAlignment;
|
||||
initial_old_size = clamp(InitialHeapSize - initial_young_size, MinOldSize, MaxOldSize);
|
||||
// MaxOldSize has already been made consistent above.
|
||||
// MaxOldSize and MinOldSize have already been made consistent above.
|
||||
} else {
|
||||
// OldSize has been explicitly set on the command line. Use it
|
||||
// for the initial size but make sure the minimum allow a young
|
||||
@ -304,9 +306,10 @@ void GenArguments::initialize_size_info() {
|
||||
", -XX:OldSize flag is being ignored",
|
||||
MaxHeapSize);
|
||||
initial_old_size = MaxOldSize;
|
||||
} else if (initial_old_size < MinOldSize) {
|
||||
log_warning(gc, ergo)("Inconsistency between initial old size and minimum old size");
|
||||
MinOldSize = initial_old_size;
|
||||
}
|
||||
|
||||
MinOldSize = MIN2(initial_old_size, MinHeapSize - MinNewSize);
|
||||
}
|
||||
|
||||
// The initial generation sizes should match the initial heap size,
|
||||
|
Loading…
Reference in New Issue
Block a user