cyberdav(a)free.fr wrote:
Hi everyone,
I've wrote that rule:
rule "COMPTEUR"
duration 10000
when
$alarme : Alarm ();
then
$alarme.increment();
update($alarme);
end
Using JProfile, I've noticed that PropagationContextImpl was constantly growing
in the heap. Then, I looked the scheduled activations and saw that some
scheduledExecutionTime was expired. So, I wrote this code to purge the expired
activations:
This was a bug early on that we fixed, atleast for normal activations,
hopefully for scheduled ones. Can you try this with 4.0.4, if it
persists, please open a JIRA for it.
Activation[] activations =
session.getAgenda().getScheduledActivations();
long now = (new Date()).getTime();
for(int i=0;i<activations.length;i++){
if( now >
((org.drools.common.ScheduledAgendaItem)activations[i]).scheduledExecutionTime()){
activations[i].remove();
}
}
Now, the heap isn't growing anymore but what are the consequences of doing
something like that? So far, there are no noticeable regression on my
application.
Thanks for your help.
Dav.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users