<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">+1</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Chris</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 3/22/19 8:42 PM, Jean Christophe
      Beyler wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAF9BGBwkQGTx+p5br9d8GNOzqa40u3P0zg12AZdaghAokb0HmA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">For what it's worth Daniil,
        <div><br>
        </div>
        <div>Webrev.02 LGTM :-)</div>
        <div><br>
        </div>
        <div>I do believe at some point we go seem to go back and forth
          about JVMCI testing and what we should do or not. I understand
          it should be a case by case in a lot of spots but perhaps we
          should document somewhere our stance for JVMCI test-bugs? Just
          food for thought?</div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>Jc</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 8:26
          PM Daniil Titov <<a href="mailto:daniil.x.titov@oracle.com"
            moz-do-not-send="true">daniil.x.titov@oracle.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank
          you, Chris!<br>
          <br>
          Please review a new version of the change that makes the test
          ignored if Graal is enabled.<br>
          <br>
          Webrev: <a
            href="http://cr.openjdk.java.net/~dtitov/8217827/webrev.02/"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://cr.openjdk.java.net/~dtitov/8217827/webrev.02/</a><br>
          Bug: <a
            href="https://bugs.openjdk.java.net/browse/JDK-8217827"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8217827</a>
          <br>
          <br>
          Best regards,<br>
          Daniil<br>
          <br>
          <br>
          <br>
          On 3/22/19, 7:59 PM, "Chris Plummer" <<a
            href="mailto:chris.plummer@oracle.com" target="_blank"
            moz-do-not-send="true">chris.plummer@oracle.com</a>>
          wrote:<br>
          <br>
              Hi Daniil,<br>
          <br>
              So 8mb is enough to do at least 10,000 iterations and
          trigger JVMCI <br>
              initialization, but the amount of memory needed after the
          System.gc() is <br>
              more than the memory used by the loop (and then freed)? I
          wonder if more <br>
              compilation is being triggered after the System.gc() call,
          and that uses <br>
              a lot of memory.<br>
          <br>
              Also, I'm not comfortable with this concept of considering
          JVMCI to be <br>
              initialized. You're making assumptions on the internal
          state of JVMCI. <br>
              Other compilations could require other allocations that
          could end up <br>
              failing. You also don't know how JVMCI behavior might
          change in the <br>
              future, causing this test to fail again. Perhaps it is
          best not to run <br>
              these ResourceExhausted tests with JVMCI. Their
          reliability is dubious <br>
              enough already.<br>
          <br>
              thanks,<br>
          <br>
              Chris<br>
          <br>
              On 3/22/19 4:02 PM, Daniil Titov wrote:<br>
              > Hi Chris,<br>
              ><br>
              > Addind -XX:+PrintCompilation flag shows that the
          first compiled method is java.lang.Object::<init>.<br>
              ><br>
              > 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.<br>
              ><br>
              > 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.<br>
              ><br>
              >    75         System.gc();<br>
              >    76         if ( ! Helper.checkResult("creating " +
          count + " objects") )<br>
              >    77             return Consts.TEST_FAILED;<br>
              >    78<br>
              >    79         return Consts.TEST_PASSED;<br>
              >    80     }<br>
              >    81<br>
              >    82     public static void main(String[] args) {<br>
              >    83         args =
          nsk.share.jvmti.JVMTITest.commonInit(args);<br>
              >    84<br>
              >    85         int result = run(args, System.out);<br>
              >    86         System.out.println(result ==
          Consts.TEST_PASSED ? "TEST PASSED" : "TEST FAILED");<br>
              >    87         System.exit(result +
          Consts.JCK_STATUS_BASE);<br>
              >    88     }<br>
              ><br>
              > Best regards,<br>
              > Daniil<br>
              ><br>
              > On 3/22/19, 2:09 PM, "Chris Plummer" <<a
            href="mailto:chris.plummer@oracle.com" target="_blank"
            moz-do-not-send="true">chris.plummer@oracle.com</a>>
          wrote:<br>
              ><br>
              >      Hi Daniil,<br>
              >      <br>
              >      What triggers the JVMCI initialization, what (in
          general) is done during<br>
              >      the initialization, and how did you come up with
          the 10k iterations and<br>
              >      a 10s sleep to ensure that initialization is
          complete?<br>
              >      <br>
              >      What was the reason for the heap size increase?
          Does the OOME happen<br>
              >      before 10k iterations if you don't increase the
          heap size?<br>
              >      <br>
              >      thanks,<br>
              >      <br>
              >      Chris<br>
              >      <br>
              >      On 3/22/19 1:53 PM, Daniil Titov wrote:<br>
              >      > Please review the change that fixes the
          failure of the test when running with Graal.<br>
              >      ><br>
              >      > 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)<br>
              >      > 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).<br>
              >      ><br>
              >      > 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.<br>
              >      ><br>
              >      > 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.<br>
              >      ><br>
              >      > Webrev: <a
            href="http://cr.openjdk.java.net/~dtitov/8217827/webrev.01/"
            rel="noreferrer" target="_blank" moz-do-not-send="true">http://cr.openjdk.java.net/~dtitov/8217827/webrev.01/</a><br>
              >      > Bug: <a
            href="https://bugs.openjdk.java.net/browse/JDK-8217827"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8217827</a><br>
              >      ><br>
              >      > Thanks!<br>
              >      > --Daniil<br>
              >      ><br>
              >      ><br>
              >      <br>
              >      <br>
              ><br>
              ><br>
          <br>
          <br>
          <br>
          <br>
          <br>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div><br>
          </div>
          Thanks,
          <div>Jc</div>
        </div>
      </div>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>