<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"><<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Yes, but it'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 <<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>> wrote:<br>
<br>
> From: Chris Selwyn <<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>><br>
</div>> Subject: Re: [rules-users] Open file leak in Drools Compiler<br>
> To: "Rules Users List" <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br>
> Cc: "Greg Barton" <<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>><br>
> Date: Wednesday, March 16, 2011, 12:18 PM<br>
<div><div></div><div class="h5">> Isn't it regarded as bad practice to<br>
> rely on the finalize() method<br>
> called by the garbage collector to release such resources?<br>
><br>
> Chris<br>
><br>
> On 16/03/2011 17:04, Greg Barton wrote:<br>
> > Only if garbage collection never runs. Then<br>
> you'd already be in trouble. :)<br>
> ><br>
> > --- On Wed, 3/16/11, Chris Selwyn<<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>> <br>
> wrote:<br>
> ><br>
> >> From: Chris Selwyn<<a href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>><br>
> >> Subject: [rules-users] Open file leak in Drools<br>
> Compiler<br>
> >> To: "Drools users"<<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br>
> >> Date: Wednesday, March 16, 2011, 11:49 AM<br>
> >> I am running Drools (actually JBoss<br>
> >> Rules 5.1.0 ) in Glassfish.<br>
> >><br>
> >> My deployable is an EJB that uses a<br>
> >> StatelessKnowledgeSession to run<br>
> >> some rules that I get from a KnowledgeAgent that<br>
> has a<br>
> >> Changeset with a<br>
> >> .drl in it.<br>
> >> Therefore, I have placed the drools compiler into<br>
> the<br>
> >> deployable and it<br>
> >> all appears to work.<br>
> >><br>
> >> Glassfish has a clever little mechanism that, when<br>
> you<br>
> >> unload a<br>
> >> deployable that had some open streams, it tells<br>
> you all<br>
> >> about it (and<br>
> >> kindly closes them).<br>
> >><br>
> >> Glassfish is reporting that InputStreams are being<br>
> left<br>
> >> open that were<br>
> >> opened in the isPackage() method of<br>
> >><br>
> org.drools.commons.jci.compilers.EclipseJavaCompiler.<br>
> >> That method has the following code in it:-<br>
> >><br>
> >> <br>
> <br>
> >> final InputStream is =<br>
> >><br>
> pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName));<br>
> >> <br>
> <br>
> >> if (is != null) {<br>
> >> <br>
> <br>
> >> return false;<br>
> >> <br>
> <br>
> >> }<br>
> >><br>
> >> So, when "is" is not null (i.e. open), it is<br>
> forgotten<br>
> >> about and not closed.<br>
> >><br>
> >> Isn't this a potential file handle leak?<br>
> >><br>
> >> Chris Selwyn<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>
> >><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>
> ><br>
> ><br>
> > -----<br>
> > No virus found in this message.<br>
> > Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
> > Version: 10.0.1204 / Virus Database: 1498/3509 -<br>
> Release Date: 03/15/11<br>
> ><br>
><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>