RFR: 8267954: Shared classes that failed to load should not be loaded again

Ioi Lam iklam at openjdk.java.net
Wed Jun 9 17:17:12 UTC 2021


On Wed, 9 Jun 2021 16:24:42 GMT, Yumin Qi <minqi at openjdk.org> wrote:

> Hi, Please review
>   Shared classes should not be loaded again at failed loading from CDS. In the failed case, restore_unshareable_info failed due to some reason (OOM), but the class already polluted and failed to be loaded again.
>   Using the unused bit in _misc_flags indicates shared loading status to prevent it from being loaded again.
> 
> Tests: tier1,tier2,tier3,tier4,tier7
> Local tests: jtreg/hotspot/runtime/cds
> TestDynamicDumpAtOom.java (which failed in tier7) with variant allocation sizes (used to reproduce the failure) passed.
> 
> Thanks
> Yumin

LGTM. Some small nits.

src/hotspot/share/classfile/systemDictionary.hpp line 84:

> 82: class TableStatistics;
> 83: 
> 84: class SharedClassLoadingMark {

I think it's better to put this class into systemDictionaryShared.hpp

src/hotspot/share/classfile/systemDictionaryShared.cpp line 1054:

> 1052:     if ((SystemDictionary::is_system_class_loader(class_loader()) && ik->is_shared_app_class())  ||
> 1053:         (SystemDictionary::is_platform_class_loader(class_loader()) && ik->is_shared_platform_class())) {
> 1054:       SharedClassLoadingMark slm(THREAD, ik);

`!ik->is_shared_boot_class()` is not needed because lines 1052 and 1053 will check for the proper loader type.

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

Marked as reviewed by iklam (Reviewer).

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


More information about the hotspot-runtime-dev mailing list