RFR: 8261455: Automatically generate the CDS archive if necessary [v2]

Ioi Lam iklam at openjdk.java.net
Wed Oct 20 21:23:03 UTC 2021


On Wed, 20 Oct 2021 18:39:42 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Please review,
>>   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:
> 
>   Removed set_set_dynamic_archive_path and refined test

Tiis overall looks good! I have a few questions and suggestions.

src/hotspot/share/cds/filemap.cpp line 183:

> 181:     if (AutoCreateSharedArchive) {
> 182:       if (!validate_archive()) {
> 183:         // regenerate shared archive at exit

validate_archive() is not called for the static archive case. Is this intentional?

src/hotspot/share/cds/filemap.cpp line 1125:

> 1123:       log_info(cds)("Base archive name is damaged");
> 1124:       return false;
> 1125:     }

I think the code can be made more readable by changing the function to `char* read_base_archive_name()`. Then there's no need to use `*target`. Also, the buffer needs to be freed in case of failure.

src/hotspot/share/runtime/thread.cpp line 3271:

> 3269:   // Same operation is being done in JVM_BeforeHalt for handling the
> 3270:   // case where the application calls System.exit().
> 3271:   if (DynamicDumpSharedSpaces && Arguments::GetSharedDynamicArchivePath() != nullptr) {

What's the reason for `Arguments::GetSharedDynamicArchivePath() != nullptr`?

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

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


More information about the hotspot-runtime-dev mailing list