RFR: 8338912: CDS: Segmented roots array [v4]
Jiangli Zhou
jiangli at openjdk.org
Fri Sep 6 18:20:04 UTC 2024
On Fri, 6 Sep 2024 17:06:16 GMT, Aleksey Shipilev <shade 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`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> Amend printout as well
@shipilev Glad to see this change. As mentioned in yesterday's premain meeting, we ran into the single roots array scalability issue trivially when experimenting with real world applications back in 2021. At the time, I reworked it to use a 'linked-roots-array' solution to accommodate a large number of roots. If the required size was larger than the limit, multiple 'roots' arrays were allocated. The last element in the current 'roots' array contained the next 'roots' array. The last element in the last 'roots' array was NULL. The multi-roots-array solution works with GC automatically, and resolves the scalability problem. Your segmented roots array change is in the same direction and is necessary to make CDS workable for real world usages.
-------------
PR Review: https://git.openjdk.org/jdk/pull/20858#pullrequestreview-2286911018
More information about the hotspot-runtime-dev
mailing list