Hi Chris,

Addind -XX:+PrintCompilation flag shows that the first compiled method is 
java.lang.Object::<init>.

Max heap size and parameter for the warmup stage (10K iterations) were found a 
posteriori, to ensure that JVMCI initialization is kicked but without throwing 
OutOfMemoryError.

The heap increase is required otherwise a second OOME is thrown in the main 
thread after line 75 and in some cases even after line 86. It seems as JVMCI 
eats out all 8Mb of the heap.

  75         System.gc();
  76         if ( ! Helper.checkResult("creating " + count + " objects") )
  77             return Consts.TEST_FAILED;
  78 
  79         return Consts.TEST_PASSED;
  80     }
  81 
  82     public static void main(String[] args) {
  83         args = nsk.share.jvmti.JVMTITest.commonInit(args);
  84 
  85         int result = run(args, System.out);
  86         System.out.println(result == Consts.TEST_PASSED ? "TEST PASSED" : 
"TEST FAILED");
  87         System.exit(result + Consts.JCK_STATUS_BASE);
  88     }

Best regards,
Daniil

On 3/22/19, 2:09 PM, "Chris Plummer" <[email protected]> wrote:

    Hi Daniil,
    
    What triggers the JVMCI initialization, what (in general) is done during 
    the initialization, and how did you come up with the 10k iterations and 
    a 10s sleep to ensure that initialization is complete?
    
    What was the reason for the heap size increase? Does the OOME happen 
    before 10k iterations if you don't increase the heap size?
    
    thanks,
    
    Chris
    
    On 3/22/19 1:53 PM, Daniil Titov wrote:
    > Please review the change that fixes the failure of the test when running 
with Graal.
    >
    > The problem here is that the test consumes all memory before JVMCI 
runtime is fully initialized. As a result the call to 
JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_EXIT)
    > at src/hotspot/share/jvmci/jvmciCompiler.cpp:132 throws OutOfmemoryError 
that is caught by CHECK_EXIT macro that in turn calls 
JVMCICompiler::exit_on_pending_exception that performs vm_exit(-1).
    >
    > The fix increases the maximum heap size the test uses and adds a delay to 
ensure the JVMCI Runtime is fully initialized before proceeding with provoking 
OutOfMemoryError.
    >
    > Before the change  the test failure rate in Mach5 builds was about 25% . 
With this change after 900 rounds in Mach5 no failure was detected. The test 
execution time  with the change is 50 second.
    >
    > Webrev: http://cr.openjdk.java.net/~dtitov/8217827/webrev.01/
    > Bug: https://bugs.openjdk.java.net/browse/JDK-8217827
    >
    > Thanks!
    > --Daniil
    >
    >
    
    


Reply via email to