<br>&nbsp;&nbsp; Eymeric,<br><br>&nbsp;&nbsp; I think what you have there is a combinatorial explosion. I.e. 5 patterns, all of the same type, doing an almost full cross product (limited only by the type attribute constraint). If you check the agenda I would expect to see a huge number of activations (it should be all possible combinations of your 53 objects).
<br><br>&nbsp;&nbsp; Anyway, there are a few fixes made to 4.0.1, including some that affect memory usage. One of the fixes we did was for increasing number of rule fires, as you can see in the following test case. Look for testOutOfMemory() method. It is a bit different of what you do, but using default 64Mb heap configuration, I left the test running 100million+ rule firings and the memory didn&#39;t blow up. The test is now limited to 3million fires so we can keep it as part of our build process. Before the fix, it was raising OOME on 
1.7million fires.<br><br><a href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
</a><br><br>&nbsp;&nbsp; Personally I think 53 objects is absurdly low. We have real use cases of companies asserting millions of facts into the working memory at once and it works just fine, with real rule sets of hundreds of rules. Maybe they manifest themselves after reading this message.
<br><br>&nbsp;&nbsp; If you think this is indeed a problem, may I ask you please to open a JIRA and submit us a self contained test showing the problem? I will profile your test and determine the causes and if it is a problem on the engine, I will fix it.
<br><br>&nbsp;&nbsp; Thank you,<br>&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/8/29, Eymeric VIEUILLE &lt;<a href="mailto:evieuille@gfi.fr">evieuille@gfi.fr</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi !<br><br>I am currently leading a study that compares BRMS. The aim of this study<br>is to determine if a rules engine can be used for our application and<br>what rules engine to use.<br><br>I made a prototype and I encountered a big problem of memory : no more
<br>than 53 objects could be passed as facts. After this threshold, I<br>encountered a java.lang.OutOfMemoryException :<br>Exception in thread &quot;main&quot; java.lang.OutOfMemoryError: Java heap space<br><br>I increased the memory allocated to the JVM, but the more I insert
<br>objects as Facts and the more Drools becomes slower !<br><br>I think that the problem is exactly the same as the following one :<br><a href="http://lists.jboss.org/pipermail/rules-users/2007-August/002592.html">http://lists.jboss.org/pipermail/rules-users/2007-August/002592.html
</a><br><br>Can you confirm to me that is the same problem ? And in a positive<br>affirmation, how to solve this problem ? And how much time would it take ?<br><br>I am using drools 4.0 (developing whith associated eclipse IDE).
<br><br>I realized a dslr that looks like this :<br>package com.sample<br><br>import XXX.Message;<br>import XXX.MyObject;<br><br>expander leg_recognizer.dsl<br><br>rule &quot;rule 1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;no-loop true<br>&nbsp;&nbsp;&nbsp;&nbsp;when<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$m1 is an &quot;OUT&quot; marker<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$m2 is an &quot;OFF&quot; marker<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$m3 is an &quot;ON&quot; marker<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$m4 is an &quot;IN&quot; marker<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$m4 event date is more than $m1 event date
<br>&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;Rule 1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display message $m1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display message $m2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display message $m3<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display message $m4<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make $m1 treated<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make $m2 treated
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make $m3 treated<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make $m4 treated<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;create a object &quot;1&quot; with state &quot;active&quot;;<br>end<br><br>rule &quot;rule 2&quot;.............(same principle) --&gt; 6 rules in the real file.
<br><br>And it uses the following dsl file :<br>[condition][]{message} is an &quot;{state}&quot; marker={message} : Message(type<br>== &quot;{state}&quot;)<br>[consequence][]print &quot;{string}&quot;=System.out.println(&quot;{string}&quot;);
<br>[consequence][]display message {object}=System.out.println(&quot;Message : &quot;<br>+ {object});<br>[consequence][]create a object &quot;{id}&quot; with state &quot;{state}&quot;=insert(new<br>MyObject(&quot;{id}&quot;, &quot;{state}&quot;));
<br>[consequence][]make {message} treated=retract({message});<br>[condition][]{message1} event date is more than {message2} event<br>date=eval({message1}.isALaterEventThanMessage({message2}))<br><br>Did I made a mistake in the use of Drools or is this a bug ?
<br><br>Thanks for answers...That&#39;s quite urgent !<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><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer
<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>