JDK-8210237 : [TESTBUG]gc/stress/TestStressIHOPMultiThread.java fails with 'Unexpected exit from test [exit code: 1]' in CDS mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-08-30
  • Updated: 2019-05-28
  • Resolved: 2018-09-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b12Fixed
Related Reports
Relates :  
Description
gc/stress/TestStressIHOPMultiThread.java fails in tier7 running in CDS mode:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 6"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 8"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 1"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 4"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 0"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 2"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 5"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 9"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 3"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread 7"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "MainThread"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

test result: Failed. Unexpected exit from test [exit code: 1]
Comments
By default, the GC region is 1m with a 128M java heap. 8m GC region size is used for stress testing, but not a real world usage. If more than 10% of the java heap is used for system objects, the test case might fail as well without CDS enabled. For example, when change the heap size to be 32M, the test case fails with OOM when running without CDS and heapUsageMaxBound is 90%. Looks like the test should be fixed to look for OOM and handle it.
14-09-2018

In the above test case, the java heap size is 128m. The test is allowed to allocate objects up to the amount of 90% (set by -DheapUsageMaxBound) of java total heap size, which is 115.2m. Object allocations in the test: 1. Allocate objects with size='HEAP_SIZE * HEAP_LOW_BOUND / 100', HEAP_LOW_BOUND is set by -DheapUsageMinBound 2. Creates a number of threads, the number of thread is determined by '-Dthreads'. Each thread allocates (HEAP_SIZE * (HEAP_HIGH_BOUND - HEAP_LOW_BOUND) / 100) / THREADS, HEAP_HIGH_BOUND is set by -DheapUsageMaxBound Each thread then frees the objects after done all allocations. The threads are running concurrently. The amount of allocation may be up to heapUsageMaxBound% (90% for the failed test case) of the total java heap at a given time. In some runs, the allocated amount (at any given time) may be < heapUsageMaxBound%, depending on when the objects are freed within a thread. That's why the test failure is not always reproducible. With the default CDS archive enabled, there are two GC regions used for mapping the archived java objects. Each GC region is 8m (-XX:G1HeapRegionSize=8m). So, 16m of java heap is used. The available space for test object allocation is <112m, which is less than 90% of the java heap size.
13-09-2018

The two failures happened on different platforms. However, both failed with following command: command: main -Xmx128m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 -XX:+UseG1GC -XX:G1HeapRegionSize=8m -XX:+G1UseAdaptiveIHOP -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread4.log -Dtimeout=2 -DheapUsageMinBound=20 -DheapUsageMaxBound=90 -Dthreads=10 TestStressIHOPMultiThread reason: User specified action: run main/othervm/timeout=200 -Xmx128m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 -XX:+UseG1GC -XX:G1HeapRegionSize=8m -XX:+G1UseAdaptiveIHOP -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread4.log -Dtimeout=2 -DheapUsageMinBound=20 -DheapUsageMaxBound=90 -Dthreads=10 TestStressIHOPMultiThread
13-09-2018