[rules-users] Best practice to use heap memory effectively

Greg Barton greg_barton at yahoo.com
Thu Nov 1 16:35:56 EDT 2012


Why not just maintain a counter object in working memory?  Just increment it whenever an alarm fact is inserted.  Reset or retract it at the end of the day.


________________________________
 From: mohan <mohan.narangoda at gmail.com>
To: rules-users at lists.jboss.org 
Sent: Thursday, November 1, 2012 3:15 PM
Subject: Re: [rules-users] Best practice to use heap memory effectively
 
Let's assume we need to calculate number of Alarm facts/events inserted into
WM over particular day. We will keep on adding facts throughout the day. If
this count greater than threshold let’s notify somebody.  Also we will
retract facts/events which are older than 24 hours. 
Can we handle this situation without single static StatefulKnowledgeSession? 

Simply can we count number of facts/events in a WM in a particular time
using multiple session? So I can call session.dispose() after each
insertion.



--
View this message in context: http://drools.46999.n3.nabble.com/Best-practice-to-use-heap-memory-effectively-tp4020194p4020656.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/20121101/3f468570/attachment.html 


More information about the rules-users mailing list