RFR: 8250989: Consolidate buffer allocation code for CDS static/dynamic dumping [v2]

Ioi Lam iklam at openjdk.java.net
Sat Feb 6 05:05:44 UTC 2021


On Thu, 4 Feb 2021 08:37:51 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> I've changed it to:
>> 
>>   // a) if CDS archive(s) have been mapped, we would have already reserved the
>>   //    ccs (immediately above the mapped archives) and initialized
>>   //    the CompressedKlassPointers encoding.
>
> No, the confusing part is the order. The old comment used future tense, this uses past tense. So to the reader it looks like mapping may already have happened. But at this point in the code the archive has not been mapped yet, no?
> Proposal:
>   // If UseCompressedClassPointers=1, we have two cases:
>   // a) if CDS is active (runtime, Xshare=on), it will create the class space
>   //    for us, initialize it and set up CompressedKlassPointers encoding.
>   //    Class space will be reserved above the mapped archives.
>   // b) if CDS either deactivated (Xshare=off) or a static dump is to be done (Xshare:dump),
>   //    we will create the class space on our own. It will be placed above the java heap,
>   //    since we assume it has been placed in low
>   //    address regions. We may rethink this (see JDK-8244943). Failing that,
>   //    it will be placed anywhere.

This looks good. I added it to the code.

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

PR: https://git.openjdk.java.net/jdk/pull/2296


More information about the hotspot-runtime-dev mailing list