RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v21]
Jonas Norlinder
duke at openjdk.org
Thu Jul 3 14:02:53 UTC 2025
On Thu, 3 Jul 2025 13:06:17 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> 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.
If `os::thread_cpu_time` fails only intermittently the numbers may indeed be misleading. However if that ever happens the machine is in a very bad state. Many places in hotspot does not check if it returns -1 at all. Maybe we should consider adding a warning or other type of error handling in `os::thread_cpu_time` but that would belong in another PR imo.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25779#issuecomment-3032390753
More information about the hotspot-gc-dev
mailing list