os::supports_vtime() and os::elapsedVTime() can be replaced by the os::[current_]thread_cpu_time() API. These APIs get user+sys times, which the new API does too.
Note that the os::thread_cpu_time() API is supported by all platforms*, so the only user of the old _vtime() API, G1, can just require it.
*) While in mainline it is not supported on *BSD except OSX, the (in)official externally maintained port at https://github.com/freebsd/openjdk/blob/jdk24u-freebsd/src/hotspot/os/bsd/os_bsd.cpp#L2609 does. There are efforts in progress to upstream the changes (https://mail.openjdk.org/pipermail/bsd-port-dev/2025-June/003231.html)
Note that the os::thread_cpu_time() API is supported by all platforms*, so the only user of the old _vtime() API, G1, can just require it.
*) While in mainline it is not supported on *BSD except OSX, the (in)official externally maintained port at https://github.com/freebsd/openjdk/blob/jdk24u-freebsd/src/hotspot/os/bsd/os_bsd.cpp#L2609 does. There are efforts in progress to upstream the changes (https://mail.openjdk.org/pipermail/bsd-port-dev/2025-June/003231.html)
- causes
-
JDK-8361238 G1 tries to get CPU info from terminated threads at shutdown
-
- Resolved
-
- duplicates
-
JDK-8160887 os::elapsedVTime() is not consistent across platforms
-
- Closed
-
-
JDK-8318937 Replace G1ConcurrentMarkThread::vtime_accum() with same value for sun.threads.cpu_time.gc_conc_mark
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/00adbbe5
-
Review openjdk/jdk/17125
-
Review(master) openjdk/jdk/26001
(1 links to)