Hi Arjun - I wouldn't recommend re-using session unless there is some expensive state you wish to reuse. Pooling them will use up far more resources then freeing them. You should only pool expensive to obtain resources.
<br><br><div><span class="gmail_quote">On 7/21/07, <b class="gmail_sendername">Arjun Dhar</b> <<a href="mailto:dhar_ar@yahoo.com">dhar_ar@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Stateless sessions should not hold onto any references. Stateful do,<br>> and dispose() must be called when its finished - otherwise the rulebase<br>> holds a reference forever. If the rulebase is holding onto stateless
<br>> sessions, then that is a bug.<br>> Mark<br>><br><br>Thanks a lot Mark,<br> taking the latest binary passed the load testing one a single thread atleast.<br>Though I need to confirm due to removal of "modify()" none of the functionality
<br>has got altered. It chokes a little in the middle but is not going out of<br>memory so I guess the leak is really fixed.<br><br>One last question on this:<br>On the Build 4MR2, I disposed the session and created a new one from the cached
<br>RuleBase and it took the load (on the code that had the memory leak)<br><br>So what approach is conceptually better; Keep the same statless session for<br>ever or for each execution request use a new one?? I talking pure
<br>performance/memory?!?!<br><br>I remember you saying creating sessions is cheap; so if I have a million<br>requests and for each one I create a new session is it still cheap? or a single<br>stateless session servicing the requests is better?
<br>Typical Application: telephone exchange; where numbers are bombarding the<br>engine. For each incomming request I'd assume a single session would be the<br>most optimal solution as long as the rules are common. Right?!
<br><br>I'm wondering if I should also maintain an image, object = {RuleBase + Globals}<br>so I can create a session. but I think this would have a huge performance cost<br>to create new sessions per request. Right?<br>
<br>Thanks for the Fix, its life saver!<br><br><br>Thanks,<br>Arjun<br><br><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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br>