<div><br></div>   Thanks for the feedback!<div><br></div><div>   Edson<br><br><div class="gmail_quote">2010/7/29 dmiller44 <span dir="ltr">&lt;<a href="mailto:dmiller@versatile.com">dmiller@versatile.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Edson,<br>
<br>
Sorry - we just solved this.  The leak isn&#39;t in Drools (which I suspected it<br>
might not be) but was in fact with java.util.concurrent.<br>
LinkedBlockingQueue.  We were running JDK 6 Update 16 - which apparently<br>
suffers from the issue described in this ticket:<br>
<a href="http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=468c6d6197d54781dd3fb3bb3dc4c?bug_id=6806875" target="_blank">http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=468c6d6197d54781dd3fb3bb3dc4c?bug_id=6806875</a><br>

Bug ID 6806875<br>
<br>
Once upgrading the JDK to Update 20, the problem went away.  Now we&#39;re<br>
seeing the performance from Drools that we have had prior to this issue :)<br>
<br>
Sorry to trouble all of you with this - hopefully if someone has similar<br>
issues, the JDK upgrade will solve it for them as well.<br>
<br>
Dan<br>
<div><div></div><div class="h5"><br>
<br>
Edson Tirelli-3 wrote:<br>
&gt;<br>
&gt;       Dan,<br>
&gt;<br>
&gt;       I am not aware of any memory leak in CR1. If you can provide me with<br>
&gt; a<br>
&gt; test case I will investigate this today. Please open a JIRA, attach your<br>
&gt; test case and let me know. If there is a leak, I need to fix it before<br>
&gt; final<br>
&gt; release.<br>
&gt;<br>
&gt;      And it is not a problem to instantiate objects in a rule&#39;s<br>
&gt; consequence.<br>
&gt; That is &quot;business as usual&quot;.<br>
&gt;<br>
&gt;      Thanks,<br>
&gt;          Edson<br>
&gt;<br>
&gt; 2010/7/28 dmiller44 &lt;<a href="mailto:dmiller@versatile.com">dmiller@versatile.com</a>&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I have a weird issue, and I&#39;m trying to figure out if this is a bug I<br>
&gt;&gt; should<br>
&gt;&gt; report, or an error in my rule.  I&#39;m running an application with a heap<br>
&gt;&gt; space (min: 512mb, max: 1024mb) that gets full and eventually overflows<br>
&gt;&gt; relatively quickly (12hrs or less).  We insert about 112 records into a<br>
&gt;&gt; Stateful Drools Session (Drools 5.1 CR1 released 7/22/2010) every<br>
&gt;&gt; 30seconds,<br>
&gt;&gt; using CLOUD session type, single thread, with fireUntilHalt.<br>
&gt;&gt;<br>
&gt;&gt; Our rules evaluate the object (A) we give it, and in some cases<br>
&gt;&gt; instantiate<br>
&gt;&gt; a new object (B) and insert it into the session.  After processing object<br>
&gt;&gt; (A), we retract it from the session.<br>
&gt;&gt;<br>
&gt;&gt; Another rule matches on object (B), and when finished, also retracts the<br>
&gt;&gt; object.<br>
&gt;&gt;<br>
&gt;&gt; When I do a heap snapshot, I&#39;ve noticed quite a few Drools-related<br>
&gt;&gt; classes,<br>
&gt;&gt; along with unreleased instantiations of object(A) &amp; object(B) (more of<br>
&gt;&gt; the<br>
&gt;&gt; latter).  Obviously I have to take into consideration that objects are<br>
&gt;&gt; being<br>
&gt;&gt; inserted at the time of the snapshot, but over a couple hours I&#39;ll have<br>
&gt;&gt; 1000&#39;s of these objects.  I&#39;ve found the only fix to be to release the<br>
&gt;&gt; session.<br>
&gt;&gt;<br>
&gt;&gt; I should note - calling session.getObjects() shows an empty list (size<br>
&gt;&gt; 0).<br>
&gt;&gt;<br>
&gt;&gt; Is this a bug? When retract is called, shouldn&#39;t it free up the<br>
&gt;&gt; FactHandle<br>
&gt;&gt; &amp;<br>
&gt;&gt; Object to be collected?  And is instantiating an object in a rule<br>
&gt;&gt; incorrect<br>
&gt;&gt; for some reason?<br>
&gt;&gt;<br>
&gt;&gt; Below is a small chart of classes - the number of instances - and space<br>
&gt;&gt; taken. (TemperatureEvent represents object (A), while AssetShallowRemote<br>
&gt;&gt; represents object (B))  Any input would be appreciated.<br>
&gt;&gt;<br>
&gt;&gt; Dan<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; | Class                                                        |<br>
&gt;&gt; Instances<br>
&gt;&gt; |<br>
&gt;&gt; Size |   |<br>
&gt;&gt;<br>
&gt;&gt; |--------------------------------------------------------------+-----------+----------+---|<br>
&gt;&gt; | java.lang.String                                             |<br>
&gt;&gt; 1155258<br>
&gt;&gt; |<br>
&gt;&gt; 41589288 |   |<br>
&gt;&gt; | char[]                                                       |<br>
&gt;&gt; 1153540<br>
&gt;&gt; |<br>
&gt;&gt; 91560120 |   |<br>
&gt;&gt; | java.util.concurrent.LinkedBlockingQueue$Node                |<br>
&gt;&gt; 329989<br>
&gt;&gt; |<br>
&gt;&gt; 10559648 |   |<br>
&gt;&gt; | java.util.LinkedHashMap$Entry                                |<br>
&gt;&gt; 153489<br>
&gt;&gt; |<br>
&gt;&gt; 9209340 |   |<br>
&gt;&gt; | java.util.HashMap$Entry                                      |<br>
&gt;&gt; 151929<br>
&gt;&gt; |<br>
&gt;&gt; 6684876 |   |<br>
&gt;&gt; | java.sql.Timestamp                                           |<br>
&gt;&gt; 117017<br>
&gt;&gt; |<br>
&gt;&gt; 4212612 |   |<br>
&gt;&gt; | org.drools.reteoo.LeftTuple                                  |<br>
&gt;&gt; 53395<br>
&gt;&gt; |<br>
&gt;&gt; 8756780 |   |<br>
&gt;&gt; | org.drools.common.AgendaItem                                 |<br>
&gt;&gt; 53390<br>
&gt;&gt; |<br>
&gt;&gt; 5819510 |   |<br>
&gt;&gt; | org.drools.retoo.RightTuple                                  |<br>
&gt;&gt; 53386<br>
&gt;&gt; |<br>
&gt;&gt; 5125056 |   |<br>
&gt;&gt; | my.test.package.AssetShallowRemote     |     42995 | 11780630 |   |<br>
&gt;&gt; | org.drools.common.DefaultFactHandle                          |<br>
&gt;&gt; 37273<br>
&gt;&gt; |<br>
&gt;&gt; 3280024 |   |<br>
&gt;&gt; | org.drools.core.util.ObjectHashSet$ObjectEntry               |<br>
&gt;&gt; 37273<br>
&gt;&gt; |<br>
&gt;&gt; 1341828 |   |<br>
&gt;&gt; | org.drools.common.PropagationContextImpl                     |<br>
&gt;&gt; 32721<br>
&gt;&gt; |<br>
&gt;&gt; 2683512 |   |<br>
&gt;&gt; | org.drools.core.util.ObjectHashMap$ObjectEntry               |<br>
&gt;&gt; 32721<br>
&gt;&gt; |<br>
&gt;&gt; 1639924 |   |<br>
&gt;&gt; | my.test.package.TemperatureEvent                     |      7165 |<br>
&gt;&gt; 917120 |   |<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Objects-not-released-from-heap-tp1002541p1002541.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Objects-not-released-from-heap-tp1002541p1002541.html</a><br>

&gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<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;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;   Edson Tirelli<br>
&gt;   JBoss Drools Core Development<br>
&gt;   JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
--<br>
</div></div>View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Objects-not-released-from-heap-tp1002541p1007840.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Objects-not-released-from-heap-tp1002541p1007840.html</a><br>

<div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<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>