<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. Our
end-to-end unit tests pass. Our load tests, however, show that memory
is never reclaimed after each call to the rules engine. After parsing
through a heap dump, we see the following path taking up over 800 meg of
memory:
<br>(kagent) KnowledgeAgentImpl$ChangeSetNotificationDetector
<br>> (kbase) KnowledgeAgentImpl
<br>>> (ruleBase) KnowledgeBaseImpl
<br>>>> (eventSupport) ReteooRuleBase
<br>>>>> (listeners) RuleBaseEventSupport
<br>>>>>> (array) CopyOnWriteArrayList
<br>>>>>>> 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). We make the following call 10K times:
<br>{
<br> "batch-execution": {
<br> "lookup": "ksession1",
<br> "commands": [
<br> {
<br> "insert": {
<br> "out-identifier": "tc_1",
<br> "object": {.....}
<br> }}]}}
<br>The knowledge-services.xml configures :
<br> - kagent id="agent1" kbase="kbase1" new-instance="true"
<br> - ksession id="ksession1" type="stateless" kbase="kbase1" node="node1" </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>