Currently, I build Drools rule package (a *.jar file) in Drools Workbench, and deploy it to a KIE server container. To request the service, I just post a XML command like below to the container, which is excerpted from here:
<batch-execution lookup="defaultKieSession">
<insert out-identifier="message" return-object="true" entry-point="DEFAULT">
<com.arty.drlwb.MyExampleType>
<message>Hello Worlddddd</message>
</com.arty.drlwb.MyExampleType>
</insert>
<fire-all-rules/>
</batch-execution>
I can get what I expected. Everything seems OK.
But I found there are two KieSessions in the rule package and don't know which one will be used. If the stateful one is used, and I the post XML command with different facts (messages here) over and over again, all facts will be kept in Drools' working memory as far as I know.
Then, would it cause memory leakage since there's no retract command? If yes, what's the correct way to format the XML command?