RFR: JDK-8312018: Improve reservation of class space and CDS [v5]

Thomas Stuefe stuefe at openjdk.org
Tue Aug 22 06:28:30 UTC 2023


On Tue, 22 Aug 2023 04:51:00 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/runtime/os.cpp line 1896:
> 
>> 1894:     for (unsigned i = 0; i < num_attempts; i++) {
>> 1895:       const unsigned deviation = stepsize > 1 ? (frand.next() % stepsize) : 0;
>> 1896:       points[i] = (i * stepsize) + deviation;
> 
> Can the last point be out of range? Maybe add an assert of something like:
> 
> 
> range_calculated with points[i] must be within [min ... max]

Okay, will add asserts. 

Note that we already assert that the resulting attach address is in range right before the mmap, but that leaves out those addresses we don't attach to since we already mmaped.

When writing this code, I spoofed the code to always result in the maximum deviation, and that worked.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15041#discussion_r1301054759


More information about the hotspot-runtime-dev mailing list