-
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
8291753: Add JFR event for GC CPU Time #9760
Conversation
👋 Welcome back sangheki! A progress list of the required criteria for merging this PR into |
/label add hotspot-gc, hotspot-jfr |
@sangheon The |
/label remove hotspot |
@sangheon |
@sangheon The |
Webrevs
|
Does this event provide CPU usage for ZGC and Shenandoah? |
Mailing list message from Sangheon Kim on hotspot-gc-dev: On 8/11/22 12:34 PM, Erik Gahlin wrote:
No. Thanks, |
Thanks for the information. Do you see any issues adding the event for those GCs (as a separate enhancement)? There are no limitation in the information the OS can provide (per thread) or how the GCs are implemented. The reason I am asking is because we want the design of the event to be future proof, so we don't end up with multiple GC CPU events. Users are likely to complain if the event is missing for some GCs. It seems like a very useful event, so I think the demand will be high for other GCs as well. Could you write in the event description which GCs that are supported? An alternative would be to write the CPU usage as a percentage, similar to the CPULoad and ThreadCPU event. It would be a periodic event emitted every second and tools could display a graph of where the system is spending time. It could perhaps be complemented with a Compiler CPU event, as a separate enhancement. |
I don't see any issues for other GCs. The only reason is that other GCs don't use the class. |
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.
Good.
@sangheon 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 113 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 |
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 rest look fine, but the inconsistency should be resolved IMO.
public: | ||
G1FullGCMark() : _gc_id(), _cpu_time() { } | ||
}; | ||
|
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 don't recall the exact reason for this, but I have a faint memory on having some discussion with its author. It's from https://bugs.openjdk.org/browse/JDK-8272651
Before this PR:
[32.328s][info ][gc ] GC(47) Pause Young (Normal) (G1 Evacuation Pause) 1162M->1032M(3072M) 323.751ms
[32.328s][info ][gc,cpu ] GC(47) User=3.22s Sys=0.00s Real=0.33s
...
[35.221s][info ][gc ] GC(48) Pause Full (System.gc()) 1134M->660M(3072M) 2650.824ms
[35.221s][info ][gc,cpu ] GC(48) User=23.97s Sys=1.49s Real=2.65s
After this PR:
[35.221s][info ][gc ] GC(48) Pause Full (System.gc()) 1134M->660M(3072M) 2650.824ms
[35.221s][info ][gc,cpu ] GC(48) User=23.97s Sys=1.49s Real=2.65s
...
[41.337s][info ][gc,cpu ] GC(49) User=27.86s Sys=1.58s Real=3.28s
[41.337s][info ][gc ] GC(49) Pause Full (System.gc()) 1094M->660M(3072M) 3283.658ms
Note that for Full-GC, the user/sys/real time is before GC-end, which is inconsistent with Young-GC.
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 agree with you and fixed.
I was aware of this issue(and JDK-8272651) at the beginning so mentioned at the RFR above, but...
|
Many thanks for the review, Thomas and Albert. /integrate |
Going to push as commit 14eb5ad.
Your commit was automatically rebased without conflicts. |
Hi all,
Could I have reviews to add new JFR event for GC CPU time?
Currently only log message is available for CPU time (user, system, real).
As there is already GCTraceCPUTime class which is used for a log message, I added GCTracer to deliver the event.
The log message of CPU time is printed after GC is completed and tried to keep same.
For G1, manually checked there is not difference.
For test, I had to add an exception as GCCpuTime will be generated after GC end.
Testing: tier 1 ~ 3
Thanks,
Sangheon
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9760/head:pull/9760
$ git checkout pull/9760
Update a local copy of the PR:
$ git checkout pull/9760
$ git pull https://git.openjdk.org/jdk pull/9760/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9760
View PR using the GUI difftool:
$ git pr show -t 9760
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9760.diff