<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Using: 5.2.0.Final of drools camel server , JSON api, and a Stateless Session<br>We are making JSON calls to the camel (execution) server. &nbsp;Our 
end-to-end unit tests pass. &nbsp;Our load tests, however, show that memory 
is never reclaimed after each call to the rules engine. &nbsp;After parsing 
through a heap dump, we see the following path taking up over 800 meg of
 memory:
<br>(kagent) KnowledgeAgentImpl$ChangeSetNotificationDetector 
<br>&gt; (kbase) KnowledgeAgentImpl 
<br>&gt;&gt; (ruleBase) KnowledgeBaseImpl 
<br>&gt;&gt;&gt; (eventSupport) ReteooRuleBase 
<br>&gt;&gt;&gt;&gt; (listeners) RuleBaseEventSupport 
<br>&gt;&gt;&gt;&gt;&gt; (array) CopyOnWriteArrayList
<br>&gt;&gt;&gt;&gt;&gt;&gt; ReteooWorkingMemory (around 864K of these)
<br><br>The rule base is very small and simple - this is only a problem during a load test (or over the course of a weeks worth of calls). &nbsp;We make the following call 10K times:
<br>{
<br>&nbsp; "batch-execution": {
<br>&nbsp; &nbsp; "lookup": "ksession1",
<br>&nbsp; &nbsp; "commands": [
<br>&nbsp; &nbsp; &nbsp; {
<br>&nbsp; &nbsp; &nbsp; &nbsp; "insert": {
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "out-identifier": "tc_1",
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "object": {.....}
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }}]}}
<br>The knowledge-services.xml configures :
<br>&nbsp;- kagent id="agent1" kbase="kbase1" new-instance="true"
<br>&nbsp;- ksession id="ksession1" type="stateless" kbase="kbase1" node="node1"&nbsp;</div><div><br></div><div>The rules just update the inserted "timecard" fact.<br><br>Because I'm using a stateless session, I don't think I need to 
dispose of the agent...and I don't think there is a way to call dispose 
using the json/Execution Command api.
<br><br>We are calling the camel (execution) server from a non-java 
environment to process employee timecards entries and evaluate for 
overtime calculations.
<br><br>Thanks!
<br>Mike
        
                                        </div></div></body></html>