Hi,<div><br></div><div>Not creating an object will not help. Objects created before can be GCed. The block will suspend GC block until the block exists or until just before OutOfMemory exception is raised.</div><div><br></div>
<div>Also this can allow API based GC and processing of GC related annotations.</div><div><br></div><div>There are times where you cannot afford to have a sizable GC pause.</div><div><br></div><div>S<br clear="all"><div><div dir="ltr">
<div><span style="font-family:'arial narrow',sans-serif">--</span></div><span style="font-family:'arial narrow',sans-serif">Suminda Sirinath Salpitikorala Dharmasena</span><span style="font-family:'arial narrow',sans-serif">, B.Sc. Comp. & I.S. (Hon.) Lond., P.G.Dip. Ind. Maths. J'Pura, MIEEE, MACM</span><span style="font-family:'arial narrow',sans-serif">, CEO </span><span style="font-family:'comic sans ms',sans-serif">Sakrīō!</span><span style="font-family:'arial narrow',sans-serif"> </span><span style="font-family:'arial narrow',sans-serif">▣ </span><b style="font-family:'arial narrow',sans-serif"><i>Address</i></b><span style="font-family:'arial narrow',sans-serif">: 6G • 1st Lane • Pagoda Road • Nugegoda 10250 • Sri Lanka. ▣ </span><b style="font-family:'arial narrow',sans-serif"><i>Tele</i></b><span style="font-family:'arial narrow',sans-serif">: +94-(0)11-5 864614 / 5 875614 / 2 825908 ▣ <b><i>Web</i></b>: <a href="http://www.sakrio.com" target="_blank">http://www.sakrio.com</a> </span><span style="font-family:'arial narrow',sans-serif">▣</span><br style="font-family:'arial narrow',sans-serif">
<br><div><font face="arial narrow, sans-serif">This email is subjected to the email Terms of Use and Disclaimer: <a href="http://www.sakrio.com/email-legal" target="_blank">http://www.sakrio.com/email-legal</a>. Please read this first.</font></div>
<div><font face="arial narrow, sans-serif">--</font></div></div></div>
<br><br><div class="gmail_quote">On 19 April 2013 15:20, Kirk Pepperdine <span dir="ltr"><<a href="mailto:kirk@kodewerk.com" target="_blank">kirk@kodewerk.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi Suminda,<div><br></div><div>With all due respect, I'm not sure that it's a great idea to pass control of the garbage collectors over to the programmer. In this case, if you were to ensure that GC did not happen during the execution of a block you are in danger of filling heap. A better way to prevent GC is to not create objects.</div>
<div><br></div><div>Regards,</div><div>Kirk<div><div class="h5"><br><div><div>On 2013-04-19, at 11:10 AM, Suminda Dharmasena <<a href="mailto:sirinath@sakrio.com" target="_blank">sirinath@sakrio.com</a>> wrote:</div>
<br><blockquote type="cite">Another potential tag to ensure GC does not happen during the execution of a code block:<div><ul><li>GCSuspend - a synchronous object can be used so that the GC threads do not run while the code block is executing</li>
</ul>
<div>Of course some revision to current annotations will be needed to accommodate this.</div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>