-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8351142: Add JFR monitor deflation and statistics events #23900
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
Conversation
|
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
|
@shipilev 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 6 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 ➡️ To integrate this PR with the above commit message to the |
test/jdk/jdk/jfr/event/runtime/TestJavaMonitorDeflateEvent.java
Outdated
Show resolved
Hide resolved
test/jdk/jdk/jfr/event/runtime/TestJavaMonitorStatisticsEvent.java
Outdated
Show resolved
Hide resolved
dholmes-ora
left a comment
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.
Seems like a good idea. I wonder why the deflation event was not added earlier?
lmesnik
left a comment
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.
Test changes looks good.
egahlin
left a comment
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.
dholmes-ora
left a comment
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'm not completely clear on how the events operate, but the general runtime changes look okay to me.
|
Fixed the merge conflicts, and touched up event descriptions a bit. @egahlin, see if those still make sense to you? |
|
Looks good overall, but I'm not sure we should add maxCount. I'm hesitant because the peak value can easily be calculated, which we already do for other events (CPULoad, NetworkUtilization, NativeMemoryUsage etc) in "jfr view". |
True, I thought about that, and still ended up adding Looking around other stats in the |
Yeah, I think it should be |
|
Since this event is only emitted once per chunk, it might be necessary to have a peak value to avoid sampling bias, but I think we should only add such metrics where there is a strong justification to do so, and where a calculated value would have failed to solve the underlying problem. I don't want to end up in a situation where we add peak, average, minimum, etc. for every event value. It adds noise and may confuse users when there are two maximum values in the GUI, one during the recording and one from when the JVM started. I agree, "peakCount" is a better name than "maxCount". |
Right, makes sense. Let's recap. The underlying reason for providing peak statistics is to track the population of object monitors without computing it from individual inflate/deflate events. Since it is periodic, it run into sampling bias. The sampling bias works not only for peaks, but also for dips, so I would guess a fuller solution would be indeed to add We want to replace one of the So, thinking that adding a new field into JFR event is easier than yanking the unnecessary/bad one, I think we should be conservative and just report the instantaneous monitor population. If we find it is insufficient, then we can talk about extending the event. Sounds good? Dropped |
|
Thank you for reviews, appreciated! I'll integrate shortly. |
|
/integrate |
|
Going to push as commit 895f64a.
Your commit was automatically rebased without conflicts. |
|
@shipilev we missed the fact the obj may be null when deflating. A bug is being filed. |
We already have JFR JavaMonitorInflate event, which tells when the monitor is inflated. We are missing JavaMonitorDeflate event, which would tell us when the monitor is deflated. This makes it hard to see the monitor lifecycle, and/or estimate the population of currently inflated monitors. I believe we should add JavaMonitorDeflate event. It would also be useful to have the statistics for the number of currently used/deflating monitors. Deflation event alone would require post-processing to investigate this, so it would be good to have the statistics event as well.
This would also replace two of the RT counters that are going away in JDK-8348829.
Monitor deflation is done asynchronously in
MonitorDeflationThread, so the additional overhead of recording the deflation events would likely be performance neutral. We still only enable the statistics event by default to be on a safer side.Additional testing:
jdk_jfrProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23900/head:pull/23900$ git checkout pull/23900Update a local copy of the PR:
$ git checkout pull/23900$ git pull https://git.openjdk.org/jdk.git pull/23900/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23900View PR using the GUI difftool:
$ git pr show -t 23900Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23900.diff
Using Webrev
Link to Webrev Comment