Re: [rules-users] OutOfMemory with BRMS 4.0.3
Hi! Are you using the WorkingMemoryLogger? Here is some information from a previous mail thread (Drools 4.02 or 4.03 memory leak?) on this list: In 4.0.3, there is a memory leak with the use of WorkingMemoryLogger. Maybe it's that ? PS : http://jira.jboss.com/jira/browse/JBRULES-1325 Regards /Mikael [EMAIL PROTECTED] wrote: Hello, I am using Drools BRMS 4.0.3 with tomcat 5.5.25, and I get OutOfMemory exceptions in tomcat regularly. I recently changed the java option of tomcat to add -Xmx512m, but it only resulted in taking a little more time before crashing (3 days, instead of 1 before). The server has nearly no access - it's a development server which is not a lot used at the moment - and there are only a few rules, for tests, so I really don't understand this error. I'm using java 1.5.0 on a linux server. The BRMS is accessed by web, to create and deploy the rules, and queried from another tool (on the same machine but in another server: in JBoss), to insert data in a workingMemory and execute the rules from the deployed package URL. I call the dispose() method on the StatefulSession at the end of the query (but this shouldn't be linked to this error, since this is in JBoss and the OutOfMemory occurs in tomcat...). Any idea? Thanks, Sophie ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- __ Mikael Larsson Redpill AB Tel. + 46 54 15 09 40 Mob. + 46 73 42 41 483 www.redpill.se __ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Design guidelines regarding session pools
Hi! I have some questions about multithreaded apps and if it is necessary to pool session objects for performance. * I understand that it is expensive to create the RuleBase objects but what about the sessions? If I create a new stateful session object for each request will that become a potential bottleneck? * Is the session class thread safe, what will happen if two or more threads simultaneously call fireAllRules on one and the same session object? One advantage of pooling session is if you have some data that does not change per request. Say that I have some data associated with a specific type of request that should be inserted for all requests of that particular type and evaluated towards request specific stuff, e.g. params in the request. E.g. An object that specifies allowed values for a particular API will be the same for all requests (well at least until you reconfigure the allowed values...) and the rules would evaluate the request specific value based on the allowed values object. In this case only the request specific parameter/value needs to be inserted/retracted per request. * I would rather use StatefulSession instead of stateless since I find the API more flexible, are there any performance considerations I should be aware of? If pooling is necessary I guess I must use the stateful session. But if creating one session per request, are there any concrete reasons for using the stateless session (besides the simpler API and that I need to call dispose on the stateful session)? Kind of hoping that the answer will be: No, pooling will not be necessary., but any feedback about situations where it may be necessary for best performance would be much appreciated. Regards, /Mikael ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Design guidelines regarding session pools
Hi! Just the answer I was hoping for, thanks for the fast reply! /Mikael Mark Proctor wrote: Mikael Larsson wrote: Hi! I have some questions about multithreaded apps and if it is necessary to pool session objects for performance. You don't need to pool session in drools, just cache the rulebase in a singleton. * I understand that it is expensive to create the RuleBase objects but what about the sessions? If I create a new stateful session object for each request will that become a potential bottleneck? sessions are lightweight, do not pool. * Is the session class thread safe, what will happen if two or more threads simultaneously call fireAllRules on one and the same session object? sessions are thread safe, apart from the iterators. One advantage of pooling session is if you have some data that does not change per request. Say that I have some data associated with a specific type of request that should be inserted for all requests of that particular type and evaluated towards request specific stuff, e.g. params in the request. E.g. An object that specifies allowed values for a particular API will be the same for all requests (well at least until you reconfigure the allowed values...) and the rules would evaluate the request specific value based on the allowed values object. In this case only the request specific parameter/value needs to be inserted/retracted per request. * I would rather use StatefulSession instead of stateless since I find the API more flexible, are there any performance considerations I should be aware of? If pooling is necessary I guess I must use the stateful session. But if creating one session per request, are there any concrete reasons for using the stateless session (besides the simpler API and that I need to call dispose on the stateful session)? stateless just wraps stateful anyway, stateless is really just a convienience api - how stateless sessions do allow for sequential rete which is a performance improvement if you don't need information (fact modications leading to rule re-evaluation) but you have to go to large number of rules and objects to see a big difference with sequential rete. Kind of hoping that the answer will be: No, pooling will not be necessary., but any feedback about situations where it may be necessary for best performance would be much appreciated. No, pooling will not be neceesary. Regards, /Mikael ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- __ Mikael Larsson Redpill AB Tel. + 46 54 15 09 40 Mob. + 46 73 42 41 483 www.redpill.se __ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users