RFR(XXS) 8230385 [cds] No message is logged when shared image cannot be used due to mismatched configuration
David Holmes
david.holmes at oracle.com
Thu Nov 28 00:49:03 UTC 2019
On 28/11/2019 10:41 am, Ioi Lam wrote:
>
>
> On 11/27/19 1:39 PM, David Holmes wrote:
>> On 28/11/2019 4:32 am, Thomas Stüfe wrote:
>>> Looks good Ioi. I'm surprised UL works this early.
>>
>> I'm also surprised. no_shared_spaces() is called from three different
>> paths - will they all work? It is hard to see by code inspection.
>>
> The three paths are all called after the VM arguments have been parsed,
> at which point UL has already been set up. So it should be safe to call
> UL. E.g., if you tell UL to save to a file:
>
> $ java -XX:-UseCompressedOops -Xlog:cds:file=foo.txt -version
> java version "14-internal" 2020-03-17
> Java(TM) SE Runtime Environment (fastdebug build
> 14-internal+0-adhoc.iklam.open)
> Java HotSpot(TM) 64-Bit Server VM (fastdebug build
> 14-internal+0-adhoc.iklam.open, mixed mode)
> $ cat foo.txt
> [0.001s][info][cds] Unable to use shared archive: UseCompressedOops and
> UseCompressedClassPointers must be on for UseSharedSpaces.
>
> In fact, all three call sites are preceded by something like:
>
> if (SomeJVMOption) { ....
>
> So if this were done before all the VM arguments are parsed, we would
> already be doing something wrong ...
>
> There are a bunch of log_debug/log_info calls in arguments.cpp. I think
> they all have the same assumption. This is kind of iffy, but that's
> beyond the scope of this patch :-)
Okay thanks for clarifying.
David
> Thanks
> - Ioi
>
>
>> Cheers,
>> David
>>
>>> Cheers, Thomas
>>>
>>> On Wed, Nov 27, 2019 at 7:29 PM Ioi Lam <ioi.lam at oracle.com> wrote:
>>>
>>>> https://bugs.openjdk.java.net/browse/JDK-8230385
>>>>
>>>> http://cr.openjdk.java.net/~iklam/jdk14/8230385-log-when-cds-is-disabled.v01/
>>>>
>>>>
>>>> Please review this one-liner addition that prints a log message when
>>>> CDS
>>>> cannot be used. Output:
>>>>
>>>> $ java -XX:-UseCompressedOops -Xlog:cds -version
>>>> [0.001s][info][cds] Unable to use shared archive: UseCompressedOops and
>>>> UseCompressedClassPointers must be on for UseSharedSpaces.
>>>> java version "14-internal" 2020-03-17
>>>> Java(TM) SE Runtime Environment (fastdebug build
>>>> 14-internal+0-adhoc.iklam.open)
>>>> Java HotSpot(TM) 64-Bit Server VM (fastdebug build
>>>> 14-internal+0-adhoc.iklam.open, mixed mode)
>>>>
>>>> Thanks
>>>> - Ioi
>>>>
>
More information about the hotspot-runtime-dev
mailing list