<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Why not just maintain a counter object in working memory? &nbsp;Just increment it whenever an alarm fact is inserted. &nbsp;Reset or retract it at the end of the day.</span></div><div><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> mohan &lt;mohan.narangoda@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> rules-users@lists.jboss.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, November 1, 2012 3:15 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Best practice to use heap memory effectively<br>
 </font> </div> <br>
Let's assume we need to calculate number of Alarm facts/events inserted into<br>WM over particular day. We will keep on adding facts throughout the day. If<br>this count greater than threshold let’s notify somebody.&nbsp; Also we will<br>retract facts/events which are older than 24 hours. <br>Can we handle this situation without single static StatefulKnowledgeSession? <br><br>Simply can we count number of facts/events in a WM in a particular time<br>using multiple session? So I can call session.dispose() after each<br>insertion.<br><br><br><br>--<br>View this message in context: http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020656.html<br>Sent from the Drools: User forum mailing list archive at <a target="_blank" href="http://nabble.com/">Nabble.com</a>.<br><br>_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org"
 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><br><br> </div> </div>  </div></body></html>