<div><br></div>   This is JCI code that we inline. We should probably check if there is a new JCI version that fixes the problem if it is indeed a problem.<div><br></div><div>   Can I ask you please to open a JIRA with the info you reported here?</div>
<div><br></div><div>   Thanks,</div><div>      Edson<br><br><div class="gmail_quote">2011/3/16 Greg Barton <span dir="ltr">&lt;<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Yes, but it&#39;s not a full blown leak.  Wrapping stream use in a try/finally block is best.  Feel free and open a JIRA to fix it.  There may be other instances.<br>
<div class="im"><br>
--- On Wed, 3/16/11, Chris Selwyn &lt;<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>&gt; wrote:<br>
<br>
&gt; From: Chris Selwyn &lt;<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>&gt;<br>
</div>&gt; Subject: Re: [rules-users] Open file leak in Drools Compiler<br>
&gt; To: &quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt; Cc: &quot;Greg Barton&quot; &lt;<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>&gt;<br>
&gt; Date: Wednesday, March 16, 2011, 12:18 PM<br>
<div><div></div><div class="h5">&gt; Isn&#39;t it regarded as bad practice to<br>
&gt; rely on the finalize() method<br>
&gt; called by the garbage collector to release such resources?<br>
&gt;<br>
&gt; Chris<br>
&gt;<br>
&gt; On 16/03/2011 17:04, Greg Barton wrote:<br>
&gt; &gt; Only if garbage collection never runs.  Then<br>
&gt; you&#39;d already be in trouble. :)<br>
&gt; &gt;<br>
&gt; &gt; --- On Wed, 3/16/11, Chris Selwyn&lt;<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>&gt; <br>
&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; From: Chris Selwyn&lt;<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>&gt;<br>
&gt; &gt;&gt; Subject: [rules-users] Open file leak in Drools<br>
&gt; Compiler<br>
&gt; &gt;&gt; To: &quot;Drools users&quot;&lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt; &gt;&gt; Date: Wednesday, March 16, 2011, 11:49 AM<br>
&gt; &gt;&gt; I am running Drools (actually JBoss<br>
&gt; &gt;&gt; Rules 5.1.0 ) in Glassfish.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; My deployable is an EJB that uses a<br>
&gt; &gt;&gt; StatelessKnowledgeSession to run<br>
&gt; &gt;&gt; some rules that I get from a KnowledgeAgent that<br>
&gt; has a<br>
&gt; &gt;&gt; Changeset with a<br>
&gt; &gt;&gt; .drl in it.<br>
&gt; &gt;&gt; Therefore, I have placed the drools compiler into<br>
&gt; the<br>
&gt; &gt;&gt; deployable and it<br>
&gt; &gt;&gt; all appears to work.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Glassfish has a clever little mechanism that, when<br>
&gt; you<br>
&gt; &gt;&gt; unload a<br>
&gt; &gt;&gt; deployable that had some open streams, it tells<br>
&gt; you all<br>
&gt; &gt;&gt; about it (and<br>
&gt; &gt;&gt; kindly closes them).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Glassfish is reporting that InputStreams are being<br>
&gt; left<br>
&gt; &gt;&gt; open that were<br>
&gt; &gt;&gt; opened in the isPackage() method of<br>
&gt; &gt;&gt;<br>
&gt; org.drools.commons.jci.compilers.EclipseJavaCompiler.<br>
&gt; &gt;&gt; That method has the following code in it:-<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;           <br>
&gt;    <br>
&gt; &gt;&gt;     final InputStream is =<br>
&gt; &gt;&gt;<br>
&gt; pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName));<br>
&gt; &gt;&gt;           <br>
&gt;    <br>
&gt; &gt;&gt;     if (is != null) {<br>
&gt; &gt;&gt;             <br>
&gt;    <br>
&gt; &gt;&gt;       return false;<br>
&gt; &gt;&gt;           <br>
&gt;    <br>
&gt; &gt;&gt;     }<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; So, when &quot;is&quot; is not null (i.e. open), it is<br>
&gt; forgotten<br>
&gt; &gt;&gt; about and not closed.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Isn&#39;t this a potential file handle leak?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Chris Selwyn<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; rules-users mailing list<br>
&gt; &gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; rules-users mailing list<br>
&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; -----<br>
&gt; &gt; No virus found in this message.<br>
&gt; &gt; Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
&gt; &gt; Version: 10.0.1204 / Virus Database: 1498/3509 -<br>
&gt; Release Date: 03/15/11<br>
&gt; &gt;<br>
&gt;<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>