RFR: 8254309: appcds GCDuringDump.java failed - class must exist

Calvin Cheung ccheung at openjdk.java.net
Fri Oct 30 18:02:54 UTC 2020


On Fri, 30 Oct 2020 00:17:22 GMT, Yumin Qi <minqi at openjdk.org> wrote:

> Hi,  Please review
>   When CDS at dump time initializes archived heap, some classes are loaded. If at this time system runs out of memory the class will not be loaded. This is what we saw in this bug. The fix checks if OOM happened, if so we print out log and exit gracefully not causing a crash. Added a test case for testing purpose when exception/OOM happens during this stage. Also check during preload classes when OOM happens, exit vm with proper message.
> 
> Tests: tier1-4
> 
> Thanks
> Yumin

Looks good.

src/hotspot/share/memory/archiveUtils.cpp line 327:

> 325:   if (exception->is_a(SystemDictionary::OutOfMemoryError_klass())) {
> 326:     vm_exit_during_cds_dumping("Out of memory. Please run with a bigger Java heap");
> 327:   }

I'd suggesting replacing 'bigger' with 'larger'.

I think it would be more informative if the message includes the MaxHeapSize setting.

test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCDuringDumpTransformer.java line 108:

> 106:     public static void makeGarbage() {
> 107:         for (int x=0; x<10; x++) {
> 108:             Object[] a = new Object[40000];

Any reason for increasing the size by 4 times?

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

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


More information about the hotspot-dev mailing list