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

David Holmes dholmes at openjdk.org
Wed Jul 2 07:25:43 UTC 2025


On Tue, 1 Jul 2025 09:33:26 GMT, Jonas Norlinder <duke at openjdk.org> wrote:

>> src/hotspot/share/runtime/os.hpp line 296:
>> 
>>> 294:   static jlong elapsed_frequency();
>>> 295: 
>>> 296:   static double elapsed_process_cpu_time();
>> 
>> Not sure if it is required that these methods return their values as `double`s in seconds. Given the uses, this seems unnecessary premature loss of precision.
>
> It is not required, but I was conforming to the same type as the methods that was removed in JDK-8274051 and as well as `elapsedTime()`. `elapsedTime()` returns the wall-clock time in seconds since start in `double`.

I don't see how there is a loss of precision here, just because the unit ahead of the decimal point is seconds. 

2.123456789 seconds still has nanosecond precision

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25779#discussion_r2179319901


More information about the hotspot-gc-dev mailing list