RFR: 8276126: Dump time class transformation causes heap objects of non-boot classes to be archived [v4]

Yumin Qi minqi at openjdk.java.net
Wed Dec 1 23:20:30 UTC 2021


On Wed, 1 Dec 2021 22:02:14 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> src/hotspot/share/classfile/classLoaderExt.cpp line 250:
>> 
>>> 248:   result->set_shared_class_loader_type(classloader_type);
>>> 249: #if INCLUDE_CDS_JAVA_HEAP
>>> 250:   if (DumpSharedSpaces && AllowArchivingWithJavaAgent && classloader_type == ClassLoader::BOOT_LOADER &&
>> 
>> the function is call during dump time (the assert at first line of this function check that) so DumpSharedSpace can be removed.
>> I am a little confused by this part:  If 'redefined' is 'true', The 'redefined' only should be enough for set disable_writing() whether other conditions stands or not?
>
> The `Arguments::assert_is_dumping_archive()` includes both static and dynamic dumping. The archiving of heap objects is performed only during static dumping. So the check for `DumpShareSpaces` is needed.
> 
> The `redefined` flag alone is not enough to disable writing heap objects to archive. If a class loaded by an AppClassLoader and is redefined, it should not disable archiving heap objects. We currently have some test cases under runtime/cds/appcds/javaldr to test that.

> 

Thanks for the explanation.

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

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


More information about the hotspot-runtime-dev mailing list