RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v9]
Jonas Norlinder
duke at openjdk.org
Mon Jun 23 13:23:29 UTC 2025
On Mon, 23 Jun 2025 13:12:28 GMT, Jonas Norlinder <duke at openjdk.org> wrote:
>> Add support to log CPU cost for GC during VM exit with `-Xlog:gc`.
>>
>>
>> [1.500s][info ][gc] GC CPU cost: 1.75%
>>
>>
>> Additionally, detailed information may be retrieved with `-Xlog:gc=trace`
>>
>>
>> [1.500s][trace][gc] Process CPU time: 4.945370s
>> [1.500s][trace][gc] GC CPU time: 0.086382s
>> [1.500s][info ][gc] GC CPU cost: 1.75%
>
> Jonas Norlinder has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
>
> - Remove incorrect is_gc_operation call after rebase
> - More clean up, remove virtual
> - Fixes after feedback from @stefank
> - Remove extra whitespace
> - operation_is_gc -> is_gc_operation per @stefank suggestion
> - Only sample if needed
> - Remove explicit super call and minor fixes
> - Add CPU time tracking for string deduplication to log_gc_vtime
> - Replace calls to log_gc_vtime with super-class method calls
> - Add bug fix after refactor and fixes for review
> - ... and 6 more: https://git.openjdk.org/jdk/compare/c748d358...553edc48
Changes:
* Fixes after feedback from @stefank
* Re-based on master so that the integration of [JDK-8360024](https://bugs.openjdk.org/browse/JDK-8360024) is included (apologies for the force-push)
* Removed conditional sampling per @tschatzl request
While CPU time may be slightly incorrect if heap dumping or heap inspection occurs, the risk is small that the number would be skewed in a significant way and we have a plan on how to mitigate with that going forward, therefore I suggest we can go ahead and integrate this now.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25779#issuecomment-2996481626
More information about the hotspot-gc-dev
mailing list