RFR: 8338912: CDS: Segmented roots array

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


On Thu, 5 Sep 2024 05:22:32 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/heapShared.cpp line 239:
> 
>> 237:   }
>> 238: 
>> 239:   objArrayOop roots = (objArrayOop)_roots->at(segment_idx).resolve();
> 
> Since we have 2 levels of objArrays, I think it's better to name them as
> 
> - root_segments[] -> root_segment0, root_segment1,  ...
> 
> 
> 
> objArrayOop HeapShared::root_segment(int segment_idx) {
> 
>   objArrayOop segment = (objArrayOop)_root_segments->at(segment_idx).resolve();
>   return segment;

Done.

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

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


More information about the hotspot-runtime-dev mailing list