RFR: 8338912: CDS: Segmented roots array

Aleksey Shipilev shade at openjdk.org
Fri Sep 6 14:22:05 UTC 2024


On Thu, 5 Sep 2024 05:37:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Attempt to drop the min region alignment with [JDK-8337828](https://bugs.openjdk.org/browse/JDK-8337828) highlights an interesting trouble. The roots array we are creating during the dump time can easily be larger than the min region alignment. We are currently "lucky" none of our tests hit this limit. AFAICS, about 128K classes would be enough to hit the current 1M min region alignment. Dropping the min region alignment to 256K starts to fail the test with "only" 30K classes, [JDK-8338856](https://bugs.openjdk.org/browse/JDK-8338856).
>> 
>> We can slice that heap root array, and thus untie the roots count from the min region alignment. I am submitting something that works, but this might not be the final form for it. I would like @iklam to poke holes in this approach :)
>> 
>> Additional testing:
>>  - [x] macos-aarch64-server-fastdebug, `runtime/cds`
>>  - [ ] linux-aarch64-server-fastdebug, `all`
>>  - [ ] linux-x86_64-server-fastdebug, `all`
>
> src/hotspot/share/cds/archiveHeapWriter.cpp line 217:
> 
>> 215: 
>> 216:     size_t oop_offset = _buffer_used;
>> 217:     _buffer_used = oop_offset + bytes_size;
> 
> Assert that `_buffer_used` is region aligned.
> Assert that `bytes_size` is the same as MIN_GC_REGION_ALIGNMENT

Hm, neither of these work, because the trailing segment might not fill the entire region (by design). We really only care that segment starts are aligned at region size, which current assert for `oop_offset` checks. We already check that `max_elem_count` produces the segment exactly of region size. So I took no action here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20858#discussion_r1747205722


More information about the hotspot-runtime-dev mailing list