RFR: JDK-8293114: JVM should trim the native heap [v7]
Thomas Stuefe
stuefe at openjdk.org
Mon Jul 10 13:06:12 UTC 2023
On Mon, 10 Jul 2023 10:54:11 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Add test with 1ms trim interval
>> - No need for atomics
>
> src/hotspot/share/runtime/trimNativeHeap.cpp line 79:
>
>> 77: // in seconds
>> 78: static double now() { return os::elapsedTime(); }
>> 79: static double to_ms(double seconds) { return seconds * 1000.0; }
>
> Would you like to just do it in `int64_t` representing milliseconds? The common way to get it is `nanos_to_millis(os::elapsed_counter())`.
>
> Turning this to integer would also obviate stuff like `MAX2(1.0, now - time)`.
I would like to retain sub-ms precision for printing.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14781#discussion_r1258230419
More information about the serviceability-dev
mailing list