-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8316632: Shenandoah: Raise OOME when gc threshold is exceeded #15852
8316632: Shenandoah: Raise OOME when gc threshold is exceeded #15852
Conversation
👋 Welcome back wkemper! A progress list of the required criteria for merging this PR into |
@earthling-amzn The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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 to me.
Please also run
|
I will run additional tests with Shenandoah enabled. |
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 have a few questions; thanks for clearing up my confusion! :-)
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.
LGTM, modulo a couple of clarifying documentation comments, as discussed.
@earthling-amzn 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 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@ysramakrishna, @shipilev) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
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.
Apologies, but I have more comments.
@@ -873,19 +874,33 @@ HeapWord* ShenandoahHeap::allocate_memory(ShenandoahAllocRequest& req) { | |||
result = allocate_memory_under_lock(req, in_new_region); | |||
} | |||
|
|||
if (result == nullptr && !req.is_lab_alloc() && get_gc_no_progress_count() > ShenandoahNoProgressThreshold) { |
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.
Can this be moved to the block that already does allocation-after-gc retries? That block already exits with nullptr
(implies delivering OOME), and it already calls handle_alloc_failure
(thus triggering GC). We "only" need it to specialize for is_lab_alloc
and ShenandoahNoProgressThreshold
?
This PR changes that block anyway...
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.
Yes, I've made this change as you suggest, but I'm not sure it improves readability. Note that when the ShenandoahNoProgressThreshold
is exceeded, we do not retry the allocation or wait for another gc cycle to complete.
test/jdk/com/sun/jdi/EATests.java
Outdated
@@ -271,7 +271,7 @@ public static class TargetVMOptions { | |||
public final boolean EliminateAllocations; | |||
public final boolean DeoptimizeObjectsALot; | |||
public final boolean DoEscapeAnalysis; | |||
public final boolean ZGCIsSelected; | |||
public final boolean ConcurrentGCIsSelected; |
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.
Let's do explicit ZGCIsSelected
and ShenandoahIsSelected
. Unfortunately, "Concurrent GC" is fairly ambiguous.
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.
All right, this looks fine.
/integrate |
@earthling-amzn |
/sponsor |
Going to push as commit 5b5fd36.
Your commit was automatically rebased without conflicts. |
@shipilev @earthling-amzn Pushed as commit 5b5fd36. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Shenandoah will run back-to-back full GCs and almost grind mutator progress to a halt before eventually exhausting memory. This change will have Shenandoah raise a gc threshold exceeded exception if the collector fails to make progress after
ShenandoahNoProgressThreshold
full GC cycles (default is 3).Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15852/head:pull/15852
$ git checkout pull/15852
Update a local copy of the PR:
$ git checkout pull/15852
$ git pull https://git.openjdk.org/jdk.git pull/15852/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15852
View PR using the GUI difftool:
$ git pr show -t 15852
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15852.diff
Webrev
Link to Webrev Comment