RFR: JDK-8312018: Improve reservation of class space and CDS [v5]
Thomas Stuefe
stuefe at openjdk.org
Tue Aug 22 05:42:29 UTC 2023
On Tue, 22 Aug 2023 04:27:39 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Roman: better comment in metaspaceShared
>> - Changes to os::vm_min_addr
>
> src/hotspot/share/memory/metaspace.cpp line 636:
>
>> 634: log_debug(metaspace, map)("Trying between " UINT64_FORMAT_X " and " UINT64_FORMAT_X
>> 635: " with " SIZE_FORMAT_X " alignment", min, max, alignment);
>> 636: result = os::attempt_reserve_memory_between((char*)min, (char*)max, size, alignment, randomize);
>
> If `try_in_low_address_ranges` is true, shouldn't `min` be no less than `zerobased_max`. Otherwise you may be searching some ranges twice.
It is already. That part searches within `1 << (32 + LogKlassAlignmentInBytes)` until `1 << 48`.
For LogKlassAlignmentInBytes=3, we search from `[0x0000_0008_0000_0000-0x0001_0000_0000_0000)`, with a step size of 0x800000000.
Its maybe clearer when one looks at the traces. I'll attach the trace point search for CDS(on, off) and randomized(true, false). The CDS=off runs contain all three searches (lower 4G, lower 32G, upper regions), the CDS=on runs only the latter.
[attach_points_cds_randomized.txt](https://github.com/openjdk/jdk/files/12405144/attach_points_cds_randomized.txt)
[attach_points_cds_nonrandomized.txt](https://github.com/openjdk/jdk/files/12405143/attach_points_cds_nonrandomized.txt)
[attach_points_no_cds_nonrandomized.txt](https://github.com/openjdk/jdk/files/12405145/attach_points_no_cds_nonrandomized.txt)
[attach_points_no_cds_randomized.txt](https://github.com/openjdk/jdk/files/12405146/attach_points_no_cds_randomized.txt)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15041#discussion_r1300968687
More information about the hotspot-runtime-dev
mailing list