[rules-users] Multi-threading inefficiency caused by static class synchronization?

Wolfgang Laun wolfgang.laun at gmail.com
Tue Dec 11 14:48:02 EST 2012


On 11 December 2012 19:20, ping <jinpingv at hotmail.com> wrote:

> Thank you. You are right the locks are guarding the session creation.
> I will try stateful session with fact retracting.
> I was using stateless session because the rules I'm going to deploy are all
> simple rules without much inference.
> So another question is: to make the multi-threading efficient, I need to
> reuse the stateful session. In that case, will the memory be a problem if I
> keep the session running too long without dispose it?


Just make sure that you retract all facts from any transaction.



> Or I need to create a
> new session once every hour or day? Or maybe retracting the facts will keep
> the memory footprint low?
>

Yes, that's the idea. - Heap memory monitoring is never a fault, though ;-)

-W


>
> -Ping
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Multi-threading-inefficiency-caused-by-static-class-synchronization-tp4021160p4021170.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121211/7a024e79/attachment.html 


More information about the rules-users mailing list