<div dir="ltr">Thanks for the input. For 150,000 type &quot;a&quot; events we had about 50,000 different ids and 1,000 user values.<div>After all, combinations possible for type &quot;b&quot; were only 1,000,000 (1,000 users * 1,000 users), which is why I am surprised to have 88 million instances.<div>
<br></div><div>Yes, it is intentional to have the rule fire twice for each combination :-) Unfortunately, retracting events is not an option right now.<br></div><div><br></div><div style>I started another round, where I ensured to insert a lot more &quot;b&quot; events: The memory used by NotNodeLeftTuples is a lot less, even though these nodes still use most of the memory.</div>
<div style>Concluding from all that, I guess it is possible that the nodes take that much space (up to many GB), and the more events are inserted which invalidate the NOT nodes, the less memory is used by them?</div><div>
<br><div class="gmail_extra"><div class="gmail_quote">2013/1/7 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The amount of memory required for 150K type &quot;a&quot; depends on the actual<br>
distribution of this data w.r.t. fields id and user, and other<br>
circumstances; it is not only the rule that is to blame.<br>
<br>
There is one flaw, though: The rule would fire twice for a matching<br>
pair of events of type &quot;a&quot;. It&#39;s possible that you do want to have a<br>
type &quot;b&quot; for both combinations of user and friendid, but you could<br>
create both in a single rule, which should halve your memory<br>
requirements. If there is no ordered attribute, use the timestamp to<br>
restrict a pair to only one combination (hint: &quot;after&quot;).<br>
<br>
This will still generate a lot of network nodes.<br>
<br>
Other ideas for reduction may have to take the entire application<br>
scenario into account, e.g., can you retract events after they have<br>
been paired, or how do you do inserts and calls to fireAllRules, etc.<br>
Most importantly, however, is the actual frequency of id and user<br>
values in relation to type &quot;a&quot; events.<br>
<br>
-W<br>
<div><div class="h5"><br>
<br>
<br>
On 07/01/2013, Svenja Brunstein &lt;<a href="mailto:svenja.brunstein@gmail.com">svenja.brunstein@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; we observe a strange behavior with one of our rules. After deployment<br>
&gt; and sending lots of events (~150,000 of type &quot;a&quot;), the server slows down<br>
&gt; rapidly until it runs out of memory.<br>
&gt; We checked with VisualVM which objects are filling the memory: In one<br>
&gt; moment there were almost 14GB of NotNodeLeftTuples (88,933,186 Instances)!<br>
&gt;<br>
&gt; This is our rule:<br>
&gt;<br>
&gt; rule &quot;example&quot;<br>
&gt; when<br>
&gt; $evt1:EventObject(type==&#39;a&#39;, $id:data[&#39;id&#39;], $user:user) from entry-point<br>
&gt; internalstream<br>
&gt; $evt2:EventObject(type==&#39;a&#39;, data[&#39;id&#39;]==$id, user!=$user, $user2:user)<br>
&gt; from entry-point internalstream<br>
&gt; not(EventObject(type==&#39;b&#39;, user==$user, data[&#39;friendid&#39;]==$user2) from<br>
&gt; entry-point internalstream)<br>
&gt; then<br>
&gt; EventObject evt = new EventObject();<br>
&gt; evt.setType(&#39;b&#39;);<br>
&gt; evt.setUser($evt1.getUser());<br>
&gt; evt.put(&#39;friendid&#39;, $evt2.getUser());<br>
&gt; entryPoints[&#39;internalstream&#39;].insert(evt);<br>
&gt; end<br>
&gt;<br>
&gt; Is that behavior correct for such a size of event combinations when using a<br>
&gt; NOT in the rule?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Svenja<br>
&gt;<br>
</div></div>_______________________________________________<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></div></div></div></div>