RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v21]

Albert Mingkun Yang ayang at openjdk.org
Thu Jul 3 13:08:44 UTC 2025


On Thu, 3 Jul 2025 12:13:59 GMT, Jonas Norlinder <duke at openjdk.org> wrote:

>> Add support to log CPU cost for GC during VM exit with `-Xlog:gc+cpu`.
>> 
>> 
>> [2,430s][info][gc,cpu] GC CPU usage: 22,87% (Process: 26,8926s GC: 6,1491s)
>
> Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Align string_dedup_cpu_time error handling to cpu_time/_vmthread_cpu_time's specification

If threads in `elapsed_gc_cpu_time` gets -1 for cpu-time, users wouldn't be notified. Instead, the log will show gc usage is 0%. Could this behavior be surprising? Even worse, if only some threads get `-1`, the final gc usage will look normal but can be off by a noticeable margin.

-------------

PR Review: https://git.openjdk.org/jdk/pull/25779#pullrequestreview-2983099464


More information about the hotspot-gc-dev mailing list