Created attachment 520553 [details] Simple reproducer. Description of problem: There is a memory leak when calling an execute method on StatelessKnowledgeSession with list of Commands(facts). See the reproducer. According to heap dump, the org.drools.command.runtime.rule.InsertElementsCommand is holding references to facts even after the execute() method is finished. This is a regression from 5.1.0 GA. Version-Release number of selected component (if applicable): BRMS 5.2.0 ER3 How reproducible: Always Steps to Reproduce: 1. Run the attached reproducer with ER3 binaries on classpath. 2. Look at stdout to see the raising heap used memory. Actual results: Heap used memory is raising. Expected results: Heap used memory is not raising. All unused object are collected. Additional info: When jBPM jars are not included in classpath, leak is away and memory usage in not raising. Memory leak does not occur when StatefulKnowledgeSession is used.
Mario Fusco has fix this issue and committed also to the 5.2.x branch. Please test.
Verified fixed in 5.2.0 ER4.
As this is the first time jbpm will be included with BRMS I have marked this issue as not requiring a release note.
A memory leak related to this issue can still happen. To see it you should change in the test attached the ksession.execute(commands) to ksession.execute(CommandFactory.newBatchExecution(commands)) I created a new pull request about it: https://github.com/droolsjbpm/drools/pull/94 If it's ok, please merge it on branch 5.3.x and upstream.
Alessandro Lazarotti <alazarot> updated the status of jira JBRULES-3217 to Reopened
Alessandro Lazarotti <alazarot> made a comment on jira JBRULES-3217 A memory leak related to this issue can still happen. To see it you should change in the test attached the ksession.execute(commands) to ksession.execute(CommandFactory.newBatchExecution(commands)) I created a new pull request about it: https://github.com/droolsjbpm/drools/pull/94 If it's ok, please merge it on branch 5.3.x and upstream.
Alessandro Lazarotti <alazarot> made a comment on jira JBRULES-3217 The test is attached at https://bugzilla.redhat.com/show_bug.cgi?id=734367
Mario Fusco <mario.fusco> updated the status of jira JBRULES-3217 to Resolved
Mario Fusco <mario.fusco> made a comment on jira JBRULES-3217 The current fix is enough and no other memory leaks can actually be reproduced on both 5.3.x and master.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.