<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Done... <a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/JBRULES-2928">https://issues.jboss.org/browse/JBRULES-2928</a><br>
    <br>
    Chris<br>
    <br>
    On 16/03/2011 18:33, Edson Tirelli wrote:
    <blockquote
      cite="mid:AANLkTinPh4Q49x7HpVTkq0UCuEexn=6kh6NhmAD_3jd_@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      &nbsp;&nbsp; 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>&nbsp;&nbsp; Can I ask you please to open a JIRA with the info you
        reported here?</div>
      <div><br>
      </div>
      <div>&nbsp;&nbsp; Thanks,</div>
      <div>&nbsp;&nbsp; &nbsp; &nbsp;Edson<br>
        <br>
        <div class="gmail_quote">2011/3/16 Greg Barton <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            Yes, but it's not a full blown leak. &nbsp;Wrapping stream use in
            a try/finally block is best. &nbsp;Feel free and open a JIRA to
            fix it. &nbsp;There may be other instances.<br>
            <div class="im"><br>
              --- On Wed, 3/16/11, Chris Selwyn &lt;<a
                moz-do-not-send="true"
                href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>&gt;
              wrote:<br>
              <br>
              &gt; From: Chris Selwyn &lt;<a moz-do-not-send="true"
                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: "Rules Users List" &lt;<a moz-do-not-send="true"
              href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
            &gt; Cc: "Greg Barton" &lt;<a moz-do-not-send="true"
              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 class="h5">&gt; Isn'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.&nbsp; Then<br>
                &gt; you'd already be in trouble. :)<br>
                &gt; &gt;<br>
                &gt; &gt; --- On Wed, 3/16/11, Chris Selwyn&lt;<a
                  moz-do-not-send="true"
                  href="mailto:chris@selwyn-family.me.uk">chris@selwyn-family.me.uk</a>&gt;&nbsp;<br>
                &gt; wrote:<br>
                &gt; &gt;<br>
                &gt; &gt;&gt; From: Chris Selwyn&lt;<a
                  moz-do-not-send="true"
                  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: "Drools users"&lt;<a
                  moz-do-not-send="true"
                  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;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
                &gt; &nbsp;&nbsp;&nbsp;<br>
                &gt; &gt;&gt;&nbsp; &nbsp;&nbsp;&nbsp;final InputStream is =<br>
                &gt; &gt;&gt;<br>
                &gt;
pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName));<br>
                &gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
                &gt; &nbsp;&nbsp;&nbsp;<br>
                &gt; &gt;&gt;&nbsp; &nbsp;&nbsp;&nbsp;if (is != null) {<br>
                &gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
                &gt; &nbsp;&nbsp;&nbsp;<br>
                &gt; &gt;&gt;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;return false;<br>
                &gt; &gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
                &gt; &nbsp;&nbsp;&nbsp;<br>
                &gt; &gt;&gt;&nbsp; &nbsp;&nbsp;&nbsp;}<br>
                &gt; &gt;&gt;<br>
                &gt; &gt;&gt; So, when "is" 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'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 moz-do-not-send="true"
                  href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
                &gt; &gt;&gt; <a moz-do-not-send="true"
                  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 moz-do-not-send="true"
                  href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
                &gt; &gt; <a moz-do-not-send="true"
                  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 moz-do-not-send="true"
                  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 moz-do-not-send="true"
                  href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
                <a moz-do-not-send="true"
                  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>
        &nbsp; Edson Tirelli<br>
        &nbsp; JBoss Drools Core Development<br>
        &nbsp; JBoss by Red Hat @ <a moz-do-not-send="true"
          href="http://www.jboss.com">www.jboss.com</a><br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <p class="avgcert" color="#000000" align="left">No virus found in
        this message.<br>
        Checked by AVG - <a moz-do-not-send="true"
          href="http://www.avg.com">www.avg.com</a><br>
        Version: 10.0.1204 / Virus Database: 1498/3511 - Release Date:
        03/16/11</p>
    </blockquote>
  </body>
</html>