<!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">
Amit Mhatre wrote:
<blockquote
 cite="mid:fad06c9b0811260951l26338002ja727e65a5e2fc207@mail.gmail.com"
 type="cite">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>
</blockquote>
This sounds like a bug. Stateless session should definitely not get
repeatedly slower - as it's really just conenience wrapper around a
stateful session.<br>
<blockquote
 cite="mid:fad06c9b0811260951l26338002ja727e65a5e2fc207@mail.gmail.com"
 type="cite"><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>
</blockquote>
Maybe someone can review the stateless session code and try and find
where the memory leak is coming from?<br>
<blockquote
 cite="mid:fad06c9b0811260951l26338002ja727e65a5e2fc207@mail.gmail.com"
 type="cite"><br>
It'd be useful to know if somebody has a better solution to Kris'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 moz-do-not-send="true"
 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'm encountering significant problems with running out of memory when
executing a small ruleset (only 16 rules, &lt; 100 facts). I'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'm using a shared RuleBase,
and I'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 moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaacf5646f8"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaacf5646f8"
 target="_blank">class net.jxta.impl.document.LiteXMLElement$charRange</a>
    <br>
26806<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaacf5631e8"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaacf5631e8"
 target="_blank">class net.jxta.impl.document.LiteXMLElement$tagRange</a>
    <br>
26733<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad66ea7f0"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad66ea7f0"
 target="_blank">class
org.eclipse.jdt.internal.compiler.lookup.MethodBinding</a>
    <br>
17366<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad66e3c88"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad66e3c88"
 target="_blank">class
[Lorg.eclipse.jdt.internal.compiler.lookup.TypeBinding;</a>
    <br>
12412<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaacf032560"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaacf032560"
 target="_blank">class
com.sun.enterprise.loader.EJBClassLoader$SentinelInputStream</a>
    <br>
10974<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad5504450"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad5504450"
 target="_blank">class
org.apache.commons.collections.SequencedHashMap$Entry</a>
    <br>
8683<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad68c3840"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad68c3840"
 target="_blank">class
org.eclipse.jdt.internal.compiler.codegen.CachedIndexEntry</a>
    <br>
7708<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaacf55e9d8"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaacf55e9d8"
 target="_blank">class net.jxta.impl.document.LiteXMLElement</a>
    <br>
7450<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad5c4b6c0"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad5c4b6c0"
 target="_blank">class org.hibernate.engine.CollectionKey</a>
    <br>
6836<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaaced3c3f8"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaaced3c3f8"
 target="_blank">class org.netbeans.modules.schema2beans.AttrProp</a>
    <br>
6271<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad6642d18"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad6642d18"
 target="_blank">class
org.eclipse.jdt.internal.compiler.lookup.FieldBinding</a>
    <br>
5643<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad6796890"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad6796890"
 target="_blank">class org.eclipse.jdt.internal.compiler.ast.MessageSend</a>
    <br>
4928<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad68a6018"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad68a6018"
 target="_blank">class
org.eclipse.jdt.internal.compiler.util.HashtableOfObject</a>
    <br>
4895<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad66e3fa8"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad66e3fa8"
 target="_blank">class
[Lorg.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;</a>
    <br>
4546<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad669f968"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad669f968"
 target="_blank">class
org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding</a>
    <br>
4472<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad687a0a8"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad687a0a8"
 target="_blank">class
[Lorg.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding;</a>
    <br>
4128<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad6103ff0"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad6103ff0"
 target="_blank">class org.drools.rule.Pattern</a>
    <br>
3899<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaacf493c90"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaacf493c90"
 target="_blank">class net.jxta.impl.id.UUID.UUID</a>
    <br>
3867<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad5c416c0"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad5c416c0"
 target="_blank">class org.hibernate.engine.EntityEntry</a>
    <br>
3731<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad5c54d88"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad5c54d88"
 target="_blank">class org.hibernate.collection.PersistentSet</a>
    <br>
3685<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad66ca420"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad66ca420"
 target="_blank">class
org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding</a>
    <br>
3360<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad6c12770"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad6c12770"
 target="_blank">class org.drools.reteoo.SingleTupleSinkAdapter</a>
    <br>
3266<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaacf543dc0"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaacf543dc0"
 target="_blank">class net.jxta.document.MimeMediaType</a>
    <br>
3264<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad6370288"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad6370288"
 target="_blank">class org.drools.spi.PatternExtractor</a>
    <br>
3163<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad5f8b990"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad5f8b990"
 target="_blank">class org.apache.axis.encoding.TypeMappingImpl$Pair</a>
    <br>
3137<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad5caad98"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad5caad98"
 target="_blank">class org.hibernate.collection.PersistentBag</a>
    <br>
2881<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad681b000"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/class/0x2aaad681b000"
 target="_blank">class
org.eclipse.jdt.internal.compiler.lookup.MethodScope</a>
    <br>
2688<a moz-do-not-send="true"
 href="http://carrot.gaiam.com:7000/instances/0x2aaad6161860"
 target="_blank"> instances</a> of <a moz-do-not-send="true"
 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 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>
    <br>
  </blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
I'm worst at what I do best, and for this gift I feel blessed<br>
-- Kurt Cobain<br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
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>
</blockquote>
<br>
</body>
</html>