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

Calvin Cheung ccheung at openjdk.java.net
Wed Dec 1 22:05:24 UTC 2021


On Wed, 1 Dec 2021 19:11:05 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove the unused stream parameter in ClassLoaderExt::record_result()
>
> 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.

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

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


More information about the hotspot-runtime-dev mailing list