<html><head></head><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">On 20 jan 2012, at 17:06, Bengt Rutisson <<a href="mailto:bengt.rutisson@oracle.com">bengt.rutisson@oracle.com</a>> wrote:</span><br></div><div><br></div><div></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 href="http://cr.openjdk.java.net/~brutisso/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><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><pre><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></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></body></html>