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

Jonas Norlinder duke at openjdk.org
Thu Jun 12 14:40:27 UTC 2025


On Thu, 12 Jun 2025 13:53:29 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Fwiw, I would prefer to have one message containing all the information, and add the `exit` tag. This decreases clutter (timestamp and tags), and allows direct selection of that message.

Thank you for sharing your concern. I'm OK with putting the CPU times currently in trace into the `exit` tag but I strongly believe we should keep the 
`[1.500s][info ][gc] GC CPU cost: 1.75%` as is. I discussed the `exit` tag option with @kstefanj but I thought that hiding the nominal values in the trace level would suffice, but can change that if we think that is preferable. I think that exposing this number at `-Xlog:gc`-level may be an important tool for users to understand that they may running with too small heap. We expose a lot of way for users to understand the memory footprint, but not too much about the CPU footprint. Putting this number behind `exit` may increase the risk that the typical user will not discover it. Adding one line at the end while at the same time logging information about each GC cycle does not clutter the message log IMO.

Another option could be to not log the nominal values at all. If one have the percentage and measure process CPU time with e.g. perf one could calculate it yourself anyways. What do you think about that?

> 
> Another problem seems to be the large amount of digits after the comma for the times; maybe use a different time scale (ms/us).

Thanks for pointing that out, I will fix that.

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

PR Comment: https://git.openjdk.org/jdk/pull/25779#issuecomment-2967112195


More information about the hotspot-gc-dev mailing list