-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8329223: Parallel: Parallel GC resizes heap even if -Xms = -Xmx #18539
Conversation
👋 Welcome back zgu! A progress list of the required criteria for merging this PR into |
@zhengyu123 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 151 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@zhengyu123 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Can |
Then the value is likely reset here: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shared/genArguments.cpp#L290 |
I meant setting |
Sorry for replying late, I was on PTO with spotty network connection. Applied the changes you suggested, I am getting following errors: |
I see; seems that there can be conflicting constraints from min, init and max triplets. Maybe sth like:
|
Make sense, updated. |
The diff is the same as before, just fyi. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what others think.
/reviewers 2
@albertnetymk |
@@ -306,7 +308,8 @@ void GenArguments::initialize_size_info() { | |||
initial_old_size = MaxOldSize; | |||
} | |||
|
|||
MinOldSize = MIN2(initial_old_size, MinHeapSize - MinNewSize); | |||
// Make sure MinOldSize <= OldSize | |||
MinOldSize = MIN2(MinOldSize, initial_old_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a test case that requires this? I'd expect MIN3
above to be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, gtest fails on MacOSX (https://github.com/zhengyu123/jdk/actions/runs/8743941793/job/23997262102)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see; why is MinOldSize
being adjusted here, instead of initial_old_size
? In the else
branch of if (!FLAG_IS_CMDLINE(OldSize)) {
, we emit warning for user-set inconsistent OldSize
, when it's above the max. For symmetry, I'd expect sth like this for the else
part:
if (initial_old_size > MaxOldSize) {
log_warning(gc, ergo)(...);
initial_old_size = MaxOldSize;
} else if (initial_old_size < MinOldSize) {
log_waring(gc, ergo)(...);
initial_old_size = MinOldSize;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the failing assert in CheckOldMin
that is causing the pthread_mutex_destroy
error msg. (I can recreate the error msg on my linux after adding a ASSERT_LT(2, 1)
there.)
Then, I think the current fix should be safe, and keeps existing tests happy.
The longer term fix should probably be removing OldSize
...
Friendly ping! Could I get a second review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Two nits/questions.
} else if (initial_old_size < MinOldSize) { | ||
log_warning(gc, ergo)("Inconsistency between initial old size and minimum old size"); | ||
MinOldSize = initial_old_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment shown below seems strange. Can it be removed?
// The generation minimums and the overall heap minimum should
// be within one generation alignment.
The warning message shown below can be more consistent with this newly added one.
log_warning(gc, ergo)("Inconsistency between maximum heap size and maximum "
"generation sizes: using maximum heap = " SIZE_FORMAT
", -XX:OldSize flag is being ignored",
MaxHeapSize);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you think they are not related to this bug, it is also OK to fix them in another ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgxbslgx Thanks for the review, filed JDK-8331432
Thanks, @albertnetymk and @lgxbslgx |
/integrate |
Going to push as commit aca1e83.
Your commit was automatically rebased without conflicts. |
@zhengyu123 Pushed as commit aca1e83. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
/backport jdk22u |
@zhengyu123 the backport was successfully created on the branch backport-zhengyu123-aca1e836 in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:
|
Parallel GC resizes old gen even when setting -Xms == -Xmx.
During GC argument setup, it always set
MinOldSize = GenAlignment
and does not make any adjustment when-Xms == -Xmx
, while does the adjustment for young gen hereProgress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18539/head:pull/18539
$ git checkout pull/18539
Update a local copy of the PR:
$ git checkout pull/18539
$ git pull https://git.openjdk.org/jdk.git pull/18539/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18539
View PR using the GUI difftool:
$ git pr show -t 18539
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18539.diff
Webrev
Link to Webrev Comment