droolsjbpm/drools — pull request #302 by mrietveld (2014-01-06 14:37:02+00:00)
Title: BZ-1044529 Memory leak (caused by kbase.getStatefulKnowledgeSessions())

Most users do not expect the .getStatefulKnowledgeSessions() to create a new SKSimpl.

However, creating a new SKSImpl leads to a memory leak (when using jBPM), illustrated by this test:

https://github.com/mrietveld/jbpm/blob/5fc93b38a6ed15de5d5433f48586c7502a72362d/jbpm-bpmn2/src/test/java/org/jbpm/leak/MemoryLeakTest.java

We can circumvent that problem by the changes in this pull request.