hi, I was facing similar issues some time back, though I was using a ruleflow and had &gt;20000 fact objects evaluated daily. The problem I was facing was that the running time would get significantly slower day by day. The solution that fixed it was to use a statefulSession and call dispose() on the session once it is done. This made a single-run slower than before, but atleast fixed the problem of exponentially increasing the run-time after several days.<br>
<br>This might not necessarily be the ideal solution, so before you move to a StatefulSession and call session.dispose() after processing, you might want to try to increase the memory for the jvm, if is lower than the size of your facts, this might fix it.<br>
<br>It&#39;d be useful to know if somebody has a better solution to Kris&#39;s problem.<br><br>Thanks,<br>- am<br><br><br><div class="gmail_quote">On Wed, Nov 26, 2008 at 9:35 AM, Kris Nuttycombe <span dir="ltr">&lt;<a href="mailto:kris.nuttycombe@gmail.com">kris.nuttycombe@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi, all,<br><br>I&#39;m encountering significant problems with running out of memory when executing a small ruleset (only 16 rules, &lt; 100 facts). I&#39;ve run jmap on the process (which has previously spawned multiple stateless sessions in parallel) and it looks like Drools, and specifically the Eclipse jdt compiler, is seriously eating up memory. The code calling the is fairly simple; one of the initial facts is an accumulator that I refer to later:<br>

<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StatelessSession session = ruleBase.newStatelessSession();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session.execute(initialFact, accumulator);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accumulator.doSomething();<br><br>where ruleBase is a shared instance, and initialFact is a base fact that is expanded during rules processing. Is there something I should be doing to dispose the session after use to release the objects created by the drools compiler after use? I&#39;m using a shared RuleBase, and I&#39;m wondering whether it is somehow keeping references around. Are these sorts of object counts to be expected?<br>

<br>Thanks,<br><br>Kris<br><center><h1>
Instance Counts for All Classes (excluding platform)</h1></center>
104827<a href="http://carrot.gaiam.com:7000/instances/0x2aaacf5646f8" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaacf5646f8" target="_blank">class net.jxta.impl.document.LiteXMLElement$charRange</a>
<br>
26806<a href="http://carrot.gaiam.com:7000/instances/0x2aaacf5631e8" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaacf5631e8" target="_blank">class net.jxta.impl.document.LiteXMLElement$tagRange</a>
<br>
26733<a href="http://carrot.gaiam.com:7000/instances/0x2aaad66ea7f0" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad66ea7f0" target="_blank">class org.eclipse.jdt.internal.compiler.lookup.MethodBinding</a>
<br>
17366<a href="http://carrot.gaiam.com:7000/instances/0x2aaad66e3c88" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad66e3c88" target="_blank">class [Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;</a>
<br>
12412<a href="http://carrot.gaiam.com:7000/instances/0x2aaacf032560" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaacf032560" target="_blank">class com.sun.enterprise.loader.EJBClassLoader$SentinelInputStream</a>
<br>
10974<a href="http://carrot.gaiam.com:7000/instances/0x2aaad5504450" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad5504450" target="_blank">class org.apache.commons.collections.SequencedHashMap$Entry</a>
<br>
8683<a href="http://carrot.gaiam.com:7000/instances/0x2aaad68c3840" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad68c3840" target="_blank">class org.eclipse.jdt.internal.compiler.codegen.CachedIndexEntry</a>
<br>
7708<a href="http://carrot.gaiam.com:7000/instances/0x2aaacf55e9d8" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaacf55e9d8" target="_blank">class net.jxta.impl.document.LiteXMLElement</a>
<br>
7450<a href="http://carrot.gaiam.com:7000/instances/0x2aaad5c4b6c0" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad5c4b6c0" target="_blank">class org.hibernate.engine.CollectionKey</a>
<br>
6836<a href="http://carrot.gaiam.com:7000/instances/0x2aaaced3c3f8" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaaced3c3f8" target="_blank">class org.netbeans.modules.schema2beans.AttrProp</a>
<br>
6271<a href="http://carrot.gaiam.com:7000/instances/0x2aaad6642d18" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad6642d18" target="_blank">class org.eclipse.jdt.internal.compiler.lookup.FieldBinding</a>
<br>
5643<a href="http://carrot.gaiam.com:7000/instances/0x2aaad6796890" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad6796890" target="_blank">class org.eclipse.jdt.internal.compiler.ast.MessageSend</a>
<br>
4928<a href="http://carrot.gaiam.com:7000/instances/0x2aaad68a6018" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad68a6018" target="_blank">class org.eclipse.jdt.internal.compiler.util.HashtableOfObject</a>
<br>
4895<a href="http://carrot.gaiam.com:7000/instances/0x2aaad66e3fa8" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad66e3fa8" target="_blank">class [Lorg.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;</a>
<br>
4546<a href="http://carrot.gaiam.com:7000/instances/0x2aaad669f968" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad669f968" target="_blank">class org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding</a>
<br>
4472<a href="http://carrot.gaiam.com:7000/instances/0x2aaad687a0a8" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad687a0a8" target="_blank">class [Lorg.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;</a>
<br>
4128<a href="http://carrot.gaiam.com:7000/instances/0x2aaad6103ff0" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad6103ff0" target="_blank">class org.drools.rule.Pattern</a>
<br>
3899<a href="http://carrot.gaiam.com:7000/instances/0x2aaacf493c90" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaacf493c90" target="_blank">class net.jxta.impl.id.UUID.UUID</a>
<br>
3867<a href="http://carrot.gaiam.com:7000/instances/0x2aaad5c416c0" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad5c416c0" target="_blank">class org.hibernate.engine.EntityEntry</a>
<br>
3731<a href="http://carrot.gaiam.com:7000/instances/0x2aaad5c54d88" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad5c54d88" target="_blank">class org.hibernate.collection.PersistentSet</a>
<br>
3685<a href="http://carrot.gaiam.com:7000/instances/0x2aaad66ca420" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad66ca420" target="_blank">class org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding</a>
<br>
3360<a href="http://carrot.gaiam.com:7000/instances/0x2aaad6c12770" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad6c12770" target="_blank">class org.drools.reteoo.SingleTupleSinkAdapter</a>
<br>
3266<a href="http://carrot.gaiam.com:7000/instances/0x2aaacf543dc0" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaacf543dc0" target="_blank">class net.jxta.document.MimeMediaType</a>
<br>
3264<a href="http://carrot.gaiam.com:7000/instances/0x2aaad6370288" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad6370288" target="_blank">class org.drools.spi.PatternExtractor</a>
<br>
3163<a href="http://carrot.gaiam.com:7000/instances/0x2aaad5f8b990" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad5f8b990" target="_blank">class org.apache.axis.encoding.TypeMappingImpl$Pair</a>
<br>
3137<a href="http://carrot.gaiam.com:7000/instances/0x2aaad5caad98" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad5caad98" target="_blank">class org.hibernate.collection.PersistentBag</a>
<br>
2881<a href="http://carrot.gaiam.com:7000/instances/0x2aaad681b000" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad681b000" target="_blank">class org.eclipse.jdt.internal.compiler.lookup.MethodScope</a>
<br>
2688<a href="http://carrot.gaiam.com:7000/instances/0x2aaad6161860" target="_blank"> instances</a> of <a href="http://carrot.gaiam.com:7000/class/0x2aaad6161860" target="_blank">class org.drools.base.ClassFieldExtractor</a>
<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></blockquote></div><br><br clear="all"><br>-- <br>I&#39;m worst at what I do best, and for this gift I feel blessed<br>-- Kurt Cobain<br>