Hi,<div><br></div><div>We&#39;re using Drools with a StatefulKnowledgeSession to process events coming from equipment in our network. The system draws conclusions about the state of the equipment and writes those conclusions to a table in our database. All our rules work as we expected and the system produces the correct results.</div>
<div><br></div><div>However, the memory usage of the JVM steadily goes up when the system runs for extended periods of time until we start getting OutOfMemoryExceptions and the server has to be restarted. This is in spite of the fact that the fact count reported by the StatefulKnowledgeSession.getFactCount() stays reasonably stable, with around 30 000 facts (give or take) at any point in time.</div>
<div><br></div><div>I have run the<span style="font-family:Arial,sans-serif;font-size:12px;line-height:16px;text-align:left;background-color:rgb(255,255,255)"> Eclipse Memory Analyzer</span> tool (<a href="http://www.eclipse.org/mat/">http://www.eclipse.org/mat/</a>) against heap dumps from the JVM several times now, and every time it reports more and more instances of org.drools.common.ScheduledAgendaItem referenced from one instance of java.lang.Object[]</div>
<div><br></div><div>To be concrete, since this morning the uptime is more than 112 hours in total, during which the system has processed little over 2 000 000 events from the network. It has 29 000 facts in the knowledge session, yet in the heap dump we see 829 632 instances of org.drools.common.ScheduledAgendaItem.</div>
<div><br></div><div>What is the ScheduledAgendaItem for? Is there something wrong with my rules that causes this many instances to be held? Is there something I should do to release these instances or the Object[] holding on to them?</div>
<div><br></div><div>Thanks,</div><div>Werner Stoop</div>