RFR: 8261455: Automatically generate the CDS archive if necessary
Ioi Lam
iklam at openjdk.java.net
Fri Dec 24 01:56:10 UTC 2021
On Thu, 23 Dec 2021 00:22:54 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
Hi Yumin, looks good. I have some preliminary comments.
src/hotspot/share/cds/dynamicArchive.cpp line 414:
> 412: bool DynamicArchive::should_dump_at_vm_exit() {
> 413: return (DynamicDumpSharedSpaces && (ArchiveClassesAtExit != nullptr)) ||
> 414: (AutoCreateSharedArchive && Arguments::GetSharedDynamicArchivePath() != nullptr);
I think it's better to do this: if `AutoCreateSharedArchive` is true, and you decide that the archive needs to be updated, then:
DynamicDumpSharedSpaces = true;
ArchiveClassesAtExit = Arguments::GetSharedDynamicArchivePath();
That way we don't need to do the check at line 414 anymore.
src/hotspot/share/cds/filemap.cpp line 207:
> 205: if (!os::file_exists(_full_path)) {
> 206: return false;
> 207: }
Is the above check necessary? If the file doesn't exist, will `check_archive()` below return false?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6920
More information about the hotspot-runtime-dev
mailing list