<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Stefan,<br>
    <br>
    It's a fundamental assumption of G1 that we never move humongous
    objects during a GC. In the future, we might consider them for
    collection during a GC, however they will either be reclaimed or be
    left where they are. Given that a humongous object takes up whole
    regions, there's no much point in moving it somewhere else.<br>
    <br>
    Tony<br>
    <br>
    On 01/20/2012 11:53 AM, Stefan Karlsson wrote:
    <blockquote cite="mid:4F199C23.5020007@oracle.com" type="cite">
      <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
      On 2012-01-20 17:56, Bengt Rutisson wrote:
      <blockquote cite="mid:4F199CA0.1090606@oracle.com" type="cite">
        <meta content="text/html; charset=UTF-8"
          http-equiv="Content-Type">
        <br>
        Stefan, are you OK with adding the assert that Tony suggested?<br>
      </blockquote>
      <br>
      Use the assert if you want to, but I don't see why that would be a
      better solution. If we ever start moving humongous objects,
      returning h() will work in production code, while the assert will
      only be found in debug builds.<br>
      <br>
      StefanK<br>
      <br>
      <blockquote cite="mid:4F199CA0.1090606@oracle.com" type="cite"> <br>
        Bengt<br>
        <br>
        On 2012-01-20 17:44, Stefan Karlsson wrote:
        <blockquote cite="mid:4F1999FD.6020009@oracle.com" type="cite">
          <meta content="text/html; charset=UTF-8"
            http-equiv="Content-Type">
          On 2012-01-20 17:46, Bengt Rutisson wrote:
          <blockquote cite="mid:4F199A60.6070506@oracle.com" type="cite">
            <meta content="text/html; charset=UTF-8"
              http-equiv="Content-Type">
            <br>
            Stefan,<br>
            <br>
            Thanks for the prompt review!<br>
            <br>
            Comments inline.<br>
            <br>
            On 2012-01-20 17:21, Stefan Karlsson wrote:
            <blockquote
              cite="mid:8C7CE33B-1215-4828-836B-EC0860F5D5CF@oracle.com"
              type="cite">
              <div><span class="Apple-style-span" style="">On 20 jan
                  2012, at 17:06, Bengt Rutisson <<a
                    moz-do-not-send="true"
                    href="mailto:bengt.rutisson@oracle.com">bengt.rutisson@oracle.com</a>>




                  wrote:</span><br>
              </div>
              <div><br>
              </div>
              <blockquote type="cite">
                <div><span></span><br>
                  <span>Hi all,</span><br>
                  <span></span><br>
                  <span>Can I have a couple of quick reviews for this
                    small change:</span><br>
                  <span><a moz-do-not-send="true"
                      href="http://cr.openjdk.java.net/%7Ebrutisso/7131791/webrev.02">http://cr.openjdk.java.net/~brutisso/7131791/webrev.02</a></span><br>
                  <span></span><br>
                  <span>This should hopefully fix the 500+ failures in
                    the G1 nightlies. So, I would like to get it in
                    before the nightlies tonight.</span><br>
                  <span></span><br>
                  <span>The issue is that we call collect() which will
                    trigger a collection without protecting the memory
                    that we just allocated for a humongous object. The
                    fix (thanks Tony for helping me out!!!) is to fake
                    an object and create a handle to it before we call
                    collect.</span><br>
                </div>
              </blockquote>
              <div><br>
              </div>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><span class="changed">1067         Handle h((oop)result);</span> </span></font></pre>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1068         collect(GCCause::_g1_humongous_allocation); </span></font></pre>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1069       } </span></font></pre>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1070       return result; </span></font></pre>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">1071     }</span></font></pre>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Can we really have a handle to uninitialized memory?</span></font></pre>
            </blockquote>
            <br>
            The memory is not uninitialized since I fake an object there
            with the call to CollectedHeap::fill_with_object(result,
            word_size, false); just before the code you have above.<br>
          </blockquote>
          <br>
          I missed that.<br>
          <br>
          <blockquote cite="mid:4F199A60.6070506@oracle.com" type="cite">
            <br>
            <blockquote
              cite="mid:8C7CE33B-1215-4828-836B-EC0860F5D5CF@oracle.com"
              type="cite">
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">Are you sure that the humongous object will not be moved by a full collection. You should probably return h() instead of result.</span></font></pre>
            </blockquote>
            <br>
            Humongous objects will not be moved by G1 collections so I
            think we are ok.<br>
          </blockquote>
          <br>
          OK. But maybe we should be a bit defensive and return h()
          here.<br>
          <br>
          StefanK<br>
          <br>
          <blockquote cite="mid:4F199A60.6070506@oracle.com" type="cite">
            <br>
            Thanks for the prompt review!<br>
            <br>
            Bengt<br>
            <blockquote
              cite="mid:8C7CE33B-1215-4828-836B-EC0860F5D5CF@oracle.com"
              type="cite">
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">
</span></font></pre>
              <pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;">StefanK</span></font></pre>
              <br>
              <blockquote type="cite">
                <div><span></span><br>
                  <span>Bengt</span><br>
                </div>
              </blockquote>
            </blockquote>
            <br>
          </blockquote>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <br>
    </blockquote>
  </body>
</html>