RFR: 8261455: Automatically generate the CDS archive if necessary [v2]
Ioi Lam
iklam at openjdk.java.net
Mon Jan 3 07:37:12 UTC 2022
On Tue, 28 Dec 2021 03:44:50 GMT, Yumin Qi <minqi at openjdk.org> wrote:
>> This patch is re-coded after serial fixes related: 8275846, 8276787, 8279018 etc.
>> original description(PR 5997):
>> `----------------------------------------------------------------------------------`
>> When shared archive (dynamic archive) failed to map due to damage of the archive file, dump/run jdk version mismatch or non-existence file etc, the new patch will automatically create a new shared archive if -XX:+AutoCreateSharedArchive specified with the name based on SharedArchiveFile.
>> This is a revised patch based on the old PR: 5077 and after bug 8273152 integrated.
>> `-----------------------------------------------------------------------------------`
>>
>> Tests: tier1,tier2,tier3,tier4
>>
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
>
> Set ArchiveClassesAtExit when AutoCreateSharedArchive is enabled
src/hotspot/share/runtime/arguments.cpp line 3145:
> 3143: if (AutoCreateSharedArchive) {
> 3144: if (SharedArchiveFile == NULL) {
> 3145: log_info(cds)("-XX:+AutoCreateSharedArchive must work with a valid SharedArchiveFile");
The log message should be consistent with other existing messages. E.g.,
fatal("-XX:+VerifyHeavyMonitors requires -XX:+UseHeavyMonitors");
So we should have:
-XX:+AutoCreateSharedArchive requires -XX:SharedArchiveFile
src/hotspot/share/runtime/arguments.cpp line 3149:
> 3147: }
> 3148: if (ArchiveClassesAtExit != NULL) {
> 3149: log_info(cds)("-XX:+AutoCreateSharedArchive does not work with ArchiveClassesAtExit");
These should be `log_warning()`. Otherwise the VM will exit without no apparent reason:
$ java -XX:+AutoCreateSharedArchive -version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6920
More information about the hotspot-runtime-dev
mailing list