<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 24 Feb 2013, at 04:11, Julian Klein &lt;<a href="mailto:julianklein@gmail.com">julianklein@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Ok, thanks. &nbsp;Here's what I have so far:<div><br></div><div style="">1) I am not retracting facts or setting expiration. &nbsp;This is by design since I am doing the next item. &nbsp;Do I need to retract globals?</div>
<div style="">2) I have disposed the session when I ran with a StatefulSession. &nbsp;I understood this means I do not need to retract facts. &nbsp;I do not attempt to reuse the session. &nbsp;I am now trying to use a StatelessSession.</div></div></blockquote>it makes no difference. Stateless is just a convenience wrapper for stateful, that avoids having to call "dispose" at the end.<br><blockquote type="cite"><div dir="ltr">
<div style="">3) Unfortunately, the rule base is very large and this will take a long time. &nbsp;I am hoping to at least get to a point where this runs end-to-end. &nbsp;If it takes several hours, I am ok with that.</div></div></blockquote>Don't let an application get this big, before you start testing.<br><blockquote type="cite"><div dir="ltr"><div style="">4) I would expect everything except "eval" statements to take advantage of indexing in my rules. &nbsp; Are you talking about BetaNode indexing? &nbsp;In all cases, I use the property access over getters.</div></div></blockquote>no not everything is indexed. Only '==' operators are indexed, and you must put the field name to the left of the operator. Until recently anything with nested accessors would not be indexed either, but that should have improved in 5.5</div><div><blockquote type="cite"><div dir="ltr">
<div style="">5) Since I am using a stateless session, I would expect no recursion.</div></div></blockquote>Statless session is just a wrapper for stateful. If the consequences modify or insert data, you get recursions.<br><blockquote type="cite"><div dir="ltr"><div style="">6) Got it. &nbsp;Thanks.</div><div style="">7) Does this only apply with a shared KnowledgeBase? &nbsp;What if I spawn multiple sessions in&nbsp;separate&nbsp;threads?</div></div></blockquote>The thread lock is per session.<br><blockquote type="cite"><div dir="ltr">
<div style=""><br></div><div style="">All in all, I reduced the allocated heap size and ran jmap as recommended by Wolfgang with a 6GB heap, 4 threads running sessions via a ForkJoinPool and less than 100K facts. &nbsp;Here is a snapshot of the top hits. &nbsp;I ran this multiple times, and just like JProfiler, the JoinNodeLeftTuple continue to grow and grow. &nbsp;I would expect this to fluctuate up and down in count and size since I am not re-using a session. &nbsp;Not being familiar with the internals of Drools, I am hoping someone could provide a sense of whether or not the below points to one of the issues Mark mentioned above. &nbsp;Also, during GC events only Eden space gets freed up so these objects appear to be living in Tenured space. &nbsp;This further concerns me that something is not being cleaned up. &nbsp;</div>
<div style=""><br></div><div style="">I fear it is all not so simple and will continue looking into Mark's list for opportunities in my code base as well as work towards simple test case. &nbsp;I appreciate all the time taken to read my rather lengthy emails. &nbsp;I am hoping that this detail will help others as it has me. &nbsp;Thank you.</div>
<div style=""><br></div><div style=""><div>&nbsp;num &nbsp; &nbsp; #instances &nbsp; &nbsp; &nbsp; &nbsp; #bytes &nbsp;class name</div><div>----------------------------------------------</div><div>&nbsp; &nbsp;1: &nbsp; &nbsp; &nbsp;61754567 &nbsp; &nbsp; 4940365360 &nbsp;org.drools.reteoo.JoinNodeLeftTuple</div>
<div>&nbsp; &nbsp;2: &nbsp; &nbsp; &nbsp; 1954644 &nbsp; &nbsp; &nbsp;109460064 &nbsp;org.drools.reteoo.RightTuple</div><div>&nbsp; &nbsp;3: &nbsp; &nbsp; &nbsp; &nbsp;302247 &nbsp; &nbsp; &nbsp; 24179760 &nbsp;org.drools.common.AgendaItem</div><div>&nbsp; &nbsp;4: &nbsp; &nbsp; &nbsp; &nbsp;447814 &nbsp; &nbsp; &nbsp; 21495072 &nbsp;com.mycompany.loader.FactsLoader &nbsp;&lt;- A bunch of callable objects that get executed to load data to send to Drools when the processor(s) is (are) idle.</div>
<div>&nbsp; &nbsp;5: &nbsp; &nbsp; &nbsp; &nbsp;302247 &nbsp; &nbsp; &nbsp; 19343808 &nbsp;org.drools.reteoo.RuleTerminalNodeLeftTuple</div><div>&nbsp; &nbsp;6: &nbsp; &nbsp; &nbsp; &nbsp;897091 &nbsp; &nbsp; &nbsp; 14353456 &nbsp;java.lang.Integer</div><div>&nbsp; &nbsp;7: &nbsp; &nbsp; &nbsp; &nbsp;447814 &nbsp; &nbsp; &nbsp; 14330048 &nbsp;java.util.RandomAccessSubList</div>
<div>&nbsp; &nbsp;8: &nbsp; &nbsp; &nbsp; &nbsp;300383 &nbsp; &nbsp; &nbsp; 11743152 &nbsp;[C</div><div>&nbsp; &nbsp;9: &nbsp; &nbsp; &nbsp; &nbsp;447815 &nbsp; &nbsp; &nbsp; 10747560 &nbsp;java.util.Collections$SynchronizedRandomAccessList</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sat, Feb 23, 2013 at 5:57 PM, Julian Klein <span dir="ltr">&lt;<a href="mailto:julianklein@gmail.com" target="_blank">julianklein@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>This is great.&nbsp; It sounds like I have to go back to the drawing board.&nbsp; It may take a while to work through this list.&nbsp; I'll circle back with outcomes.</p><p>Thank you.</p>
</blockquote></div><br></div>
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users</blockquote></div><br></body></html>