<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 19 Feb 2013, at 15:57, 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, so I reviewed my code again and found a spot where I am queuing up tasks to process data that hadn't been loaded. &nbsp;My application shouldn't spawn a rule sessions in the case. &nbsp;I have also moved to a sever with less RAM and will begin profiling as soon as possible. &nbsp; Here is where I stand as of now:<div>
<br></div><div>1) I am still seeing about 250 million JoinNodeLeftTuples (eats up about 30GB of RAM). &nbsp;This greatly outnumbers anything else in the system by a factor of 100x.</div><div style="">2) Creating a test case will be very difficult as I cannot pinpoint the root cause of this issue. &nbsp;I am not sure if it is related to too many rules engine, the size of my ruleset, or simply the scale at which I am attempting to use Drools. &nbsp;If I pinpoint an actual memory leak, I will create a test case and submit.</div>
<div style="">3) I cannot use a StatelessKnowledgeSession as it locks my process up. &nbsp;It seems the code in&nbsp;StatelessKnowledgeSessionImpl's constructor creates a lock that never releases. &nbsp;No idea on this either for now.</div>
<div style=""><br></div><div style=""><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.ruleBase.lock();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( ruleBase.getConfiguration().isSequential() ) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.ruleBase.getReteooBuilder().order();</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } finally {</div><div><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.ruleBase.unlock(); &nbsp; &lt;--- This line is never reached for some reason</b></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp;</div><div style="">I will continue trying to find a root cause or path forward and report back. &nbsp;If anything here gives you all a sense of some wrongdoing on my behalf, please let me know. &nbsp;I don't fully understand sequential mode as the documentation is not approachable from my uninformed perspective. &nbsp;So perhaps there is something I am doing in my rules that leads to this lock not getting release?</div></div></div></blockquote>Sequential mode means no inference. If you want to modify or insert facts and have them evaluated in the rules, then you don't want sequential mode.<br><blockquote type="cite"><div dir="ltr"><div style="">
<div style=""><br></div><div style="">Thanks again,</div><div style="">Julian</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 18, 2013 at 9:13 AM, 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"><div dir="auto"><div>Unfortunately the server I was using locked up last night and I cannot get access. &nbsp;I'll have to find an interim system where I can run tests and profile the heap. &nbsp;In the meantime, I switched to a Sequential Stateless Session. &nbsp;I don't know the internals of Drools, but since this seems to turn off the left input propagation, does that mean the JoinLeftNode is not used?</div>
<div><br></div><div>I am running 5.4 .0 on Linux. &nbsp;If I see the same issues with a stateless approach, I will try the 5.5 approach.</div><div><br></div><div>Thanks again,</div><div>Julian<div><div class="h5"><br><br>On Feb 17, 2013, at 6:19 PM, Mark Proctor &lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</a>&gt; wrote:<br>
<br></div></div></div><div><div class="h5"><blockquote type="cite">You'll need to help us a bit here, by creating a test of some sort. "I have 100 rules with 1B JoinLeftNode" doesn't give us much to go on.<div>
<br></div><div>The problem mentioned earlier was related to windows, which I don't think you are using - or you'd have said so.</div><div><br></div><div>Also can you tell us what version you are using? Could you maybe try the 5..5.x branch which has a lot of fixes in it (you'll need to build it with maven):</div>
<div><a href="https://github.com/droolsjbpm/drools/tree/5.5.x" target="_blank">https://github.com/droolsjbpm/drools/tree/5.5.x</a></div><div><br></div><div>mark<br><div><div>On 17 Feb 2013, at 18:27, Julian Klein &lt;<a href="mailto:julianklein@gmail.com" target="_blank">julianklein@gmail.com</a>&gt; wrote:</div>
<br><blockquote type="cite"><div dir="ltr">Thanks again. I have tried Sequential mode, but somehow my Java based class that I use for function calls no longer receives them. &nbsp;Perhaps there is an error occurring before the call to my class in the "then" section of the rule that is not presenting itself in my logs. &nbsp;Either that or I don't understand sequential mode's limitations well enough. &nbsp;I'll try it one more time and report back on that as well.</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 17, 2013 at 1:17 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@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"><div>On 17/02/2013, Julian Klein &lt;<a href="mailto:julianklein@gmail.com" target="_blank">julianklein@gmail.com</a>&gt; wrote:<br>


</div><div>&gt; Ok, I witnessed this with JProfiler. &nbsp;I will try with jmap to make sure and<br>
&gt; report back later today or tomorrow. &nbsp; Is it safe then to assume that<br>
&gt; discarding (dispose) the session between laps is better from a throughput<br>
&gt; perspective than re-using it?<br>
<br>
</div>If you need to start each session with a clean slate: yes, dispose is<br>
preferable.<br>
<div><br>
&gt; &nbsp;Also, would using a Stateless Session<br>
&gt; "perform" better from either a memory or CPU perspective?<br>
<br>
</div>Only if you can run it in "sequential mode" - see Expert, 3.3.7.1.<br>
Sequential Mode<br>
<br>
-W<br>
<br>
&gt;<br>
&gt; Thanks again!<br>
<div>&gt;<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br></div>
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote>
</div><br></div></blockquote><blockquote type="cite"><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span></blockquote></div></div></div></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>