RFR: 8267189: Remove duplicated unregistered classes from dynamic archive
Yumin Qi
minqi at openjdk.java.net
Thu Jun 17 18:11:27 UTC 2021
On Thu, 17 Jun 2021 04:03:09 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> In the CDS archive, "unregistered" classes are those to be loaded by custom loaders.
>
> When doing a CDS dynamic dump (with -XX:ArchiveClassesAtExit=foo.jsa), a class of the same name may be loaded by several custom class loaders. Currently we write all of these unregistered classes into the archive. However, only one copy of them will be usable at runtime.
>
> For size saving, we should avoid writing such duplicated classes into the archive.
>
> (Note that this problem does not affect the CDS static dump, which is driven by a classlist file. We already disallow duplicate unregistered classes in the classlist.)
>
> Testing: mach5 tiers 1-4. Also tested locally with Eclipse IDE.
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DuplicatedCustomTest.java line 2:
> 1: /*
> 2: * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
New added file only need the added year.
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/DuplicatedCustomApp.java line 2:
> 1: /*
> 2: * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
Same here.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4515
More information about the hotspot-runtime-dev
mailing list