<br><br><div class="gmail_quote">On 11 December 2012 19:20, ping <span dir="ltr">&lt;<a href="mailto:jinpingv@hotmail.com" target="_blank">jinpingv@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank you. You are right the locks are guarding the session creation.<br>
I will try stateful session with fact retracting.<br>
I was using stateless session because the rules I&#39;m going to deploy are all<br>
simple rules without much inference.<br>
So another question is: to make the multi-threading efficient, I need to<br>
reuse the stateful session. In that case, will the memory be a problem if I<br>
keep the session running too long without dispose it?</blockquote><div><br>Just make sure that you retract all facts from any transaction.<br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 Or I need to create a<br>
new session once every hour or day? Or maybe retracting the facts will keep<br>
the memory footprint low?<br></blockquote><div><br>Yes, that&#39;s the idea. - Heap memory monitoring is never a fault, though ;-)<br><br>-W<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
-Ping<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Multi-threading-inefficiency-caused-by-static-class-synchronization-tp4021160p4021170.html" target="_blank">http://drools.46999.n3.nabble.com/Multi-threading-inefficiency-caused-by-static-class-synchronization-tp4021160p4021170.html</a><br>

Sent from the Drools: User forum 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>
</blockquote></div><br>