Skip to content

8003216: Add JFR event indicating explicit System.gc() call #4456

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

Closed
wants to merge 1 commit into from

Conversation

egahlin
Copy link
Member

@egahlin egahlin commented Jun 10, 2021

Hi,

This is a continuation of a review that started before the pandemic.

In an offline discussion with Stefan Johansson, we looked into adding GC id to the SystemGC event, but it was not trivial. Still, it would make sense to have this event to see the stack trace of the System GC call. GC id can always be added as another enhancement. I added a field that indicates the status of -XX:+ExplicitGCInvokesConcurrent, to hint to users that the duration of the event may not be the time the GC took.

I only emit the event if a GC is triggered, so there is no need for a field -XX:+DisableExplicitGC which we talked about back then. The reason is that it could potentially create many events in the default configuration, for example if called every rendered frame. I also think users want to track calls that actually led to a GC. If there is a need for a second field, it could be added as another enhancement later.

Testing: tier1/tier2 + test/jdk/jdk/jfr

Thanks
Erik


Progress

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

Error

 ⚠️ This PR only contains changes already present in the target

Issue

  • JDK-8003216: Add JFR event indicating explicit System.gc() call ⚠️ Issue is not open.

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4456

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

Using diff file

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

@egahlin egahlin marked this pull request as draft June 10, 2021 08:25
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 10, 2021

👋 Welcome back egahlin! A progress list of the required criteria for merging this PR into master 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 10, 2021

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

  • hotspot

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 hotspot-dev@openjdk.org label Jun 10, 2021
@egahlin
Copy link
Member Author

egahlin commented Jun 10, 2021

/label remove hotspot

@egahlin
Copy link
Member Author

egahlin commented Jun 10, 2021

/label add hotspot-jfr

@egahlin
Copy link
Member Author

egahlin commented Jun 10, 2021

/label add hotspot-gc

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Jun 10, 2021
@openjdk
Copy link

openjdk bot commented Jun 10, 2021

@egahlin
The hotspot label was successfully removed.

@openjdk openjdk bot added the hotspot-jfr hotspot-jfr-dev@openjdk.org label Jun 10, 2021
@openjdk
Copy link

openjdk bot commented Jun 10, 2021

@egahlin
The hotspot-jfr label was successfully added.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Jun 10, 2021
@openjdk
Copy link

openjdk bot commented Jun 10, 2021

@egahlin
The hotspot-gc label was successfully added.

@egahlin egahlin marked this pull request as ready for review June 10, 2021 08:45
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 10, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 10, 2021

Webrevs

@openjdk
Copy link

openjdk bot commented Jun 10, 2021

@egahlin This change is no longer ready for integration - check the PR body for details.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 10, 2021
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.

@egahlin
Copy link
Member Author

egahlin commented Jun 10, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Jun 10, 2021

Going to push as commit e11f70a.
Since your change was applied there have been 27 commits pushed to the master branch:

  • 2b41459: 8267073: Race between Card Redirtying and Freeing Collection Set regions results in missing remembered set entries with G1
  • 7cd5a6e: 8268537: (Temporary) Disable ParallelRefProcEnabled for Parallel GC
  • f716711: 8265271: JFR: Allow use of .jfc options when starting JFR
  • f677163: 8266130: convert Thread-SMR stress tests from counter based to time based
  • 6c552a7: 8268544: some runtime/sealedClasses tests should be run in driver mode
  • f4b3170: 8268428: Test java/foreign/TestResourceScope.java fails: expected [M] but found [N]
  • 6b6ff53: 8268543: some runtime/verifier tests should be run in driver mode
  • 0924382: 8266766: Arrays of types that cannot be an annotation member do not yield exceptions
  • d43c8a7: 8268124: Update java.lang to use switch expressions
  • a187fcc: 8238197: JFR: Rework setting and getting EventHandler
  • ... and 17 more: https://git.openjdk.java.net/jdk/compare/58ba48b7b88eff359683aa3271c48b18f1973282...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jun 10, 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 10, 2021
@openjdk
Copy link

openjdk bot commented Jun 10, 2021

@egahlin Pushed as commit e11f70a.

💡 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 hotspot-jfr hotspot-jfr-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants