RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v3]
Jonas Norlinder
duke at openjdk.org
Fri Jun 13 10:50:39 UTC 2025
On Thu, 12 Jun 2025 15:25:08 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 incrementally with two additional commits since the last revision:
>
> - Refactor shared logic into CollectedHeap, remove nominal logging and cost->usage
> - Remove unnecessary assert
Additionally, if we want to we can also add capabilities to track it continuously with JFR and/or MXBeans. But that may introduce a performance penalty as sampling may not be free so I want to still keep logging it at the end as a base case.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25779#issuecomment-2969931470
More information about the hotspot-gc-dev
mailing list