Skip to content
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

8268122: Add specific gc cause for G1 full collections #4357

Closed
wants to merge 5 commits into from

Conversation

kstefanj
Copy link
Contributor

@kstefanj kstefanj commented Jun 4, 2021

Please review this change to add a new GC cause for GC Full collections that are caused by a prior collection not being able to free up enough space.

Summary
During the review of PR #3143 it got pretty clear that reusing the Young GC cause for a following Full GC is not always good. A solution for this is to add a new GC cause that is used if a young collection can't free up enough space. This cause will not be used for other explicit Full GCs, like a call to System.gc().

The would result in a change from:

[13,276s][info][gc             ] GC(71) Pause Young (Normal) (G1 Evacuation Pause) 3096M->3096M(3100M) 1,159ms
[13,644s][info][gc             ] GC(72) Pause Full (G1 Evacuation Pause) 3096M->3096M(3100M) 368,157ms

to:

[18,454s][info][gc             ] GC(84) Pause Young (Normal) (G1 Evacuation Pause) 3096M->3096M(3100M) 1,312ms
[18,815s][info][gc             ] GC(85) Pause Full (G1 Compaction Pause) 3096M->3096M(3100M) 360,737ms

This PR is currently based in PR #4342, where we slightly change how Full GCs are scheduled if a Younc GC can't free up enough space.

Testing
I've tested this change together with PR #4342 and tier1-3 looks good. Also done manual testing making sure the GC-cause is used correctly.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8268122: Add specific gc cause for G1 full collections

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4357/head:pull/4357
$ git checkout pull/4357

Update a local copy of the PR:
$ git checkout pull/4357
$ git pull https://git.openjdk.java.net/jdk pull/4357/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4357

View PR using the GUI difftool:
$ git pr show -t 4357

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4357.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 4, 2021

👋 Welcome back sjohanss! A progress list of the required criteria for merging this PR into pr/4342 will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 4, 2021

@kstefanj The following label will be automatically applied to this pull request:

  • hotspot-gc

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.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Jun 4, 2021
@kstefanj kstefanj marked this pull request as ready for review June 4, 2021 11:37
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 4, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 4, 2021

Webrevs

Also removing Allocation Failure cause which should not be used by G1 collections.
Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm.

Pre-existing: The two changed tests seem to be exactly the same....

@kstefanj
Copy link
Contributor Author

kstefanj commented Jun 7, 2021

Lgtm.

Pre-existing: The two changed tests seem to be exactly the same....

The "G1ConcurrentMark" test is run with -XX:+ExplicitGCInvokesConcurrent so there is a small difference in that we will get an explicit young GC with System.gc() as the cause.

I just pushed a small change to move the new cause up to under the "G1 Evacuation Pause" in the enum.

Copy link

@kimbarrett kimbarrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@openjdk-notifier openjdk-notifier bot changed the base branch from pr/4342 to master June 9, 2021 13:44
@openjdk-notifier
Copy link

The dependent pull request has now been integrated, and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout 8268163-full-gc-order
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk
Copy link

openjdk bot commented Jun 9, 2021

@kstefanj this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout 8268122-gc-cause
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Jun 9, 2021
@openjdk
Copy link

openjdk bot commented Jun 9, 2021

@kstefanj 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:

8268122: Add specific gc cause for G1 full collections

Reviewed-by: tschatzl, kbarrett

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 1 new commit pushed to the master branch:

  • 43e38a1: 8268377: Windows 32bit build fails after JDK-8268174

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed merge-conflict Pull request has merge conflict with target branch labels Jun 9, 2021
@kstefanj
Copy link
Contributor Author

kstefanj commented Jun 9, 2021

Thanks @tschatzl and @kimbarrett for the reviews.

/integrate

@openjdk openjdk bot closed this Jun 9, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 9, 2021
@openjdk
Copy link

openjdk bot commented Jun 9, 2021

@kstefanj Since your change was applied there has been 1 commit pushed to the master branch:

  • 43e38a1: 8268377: Windows 32bit build fails after JDK-8268174

Your commit was automatically rebased without conflicts.

Pushed as commit caf7f49.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants