-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
None
-
2018 Week 33-35
-
NEW
-
NEW
As discussed in https://groups.google.com/forum/#!topic/drools-usage/V8ypP1o5SwM :
In order to reduce memory allocations we are calling StatefulKnowledgeSessionImpl.reset() to bring a disposed session back into life. From our understanding this is the same method which the Drools session cache would use. During our tests we found that some of our rules don't trigger if we use this approach. We also found that the reset method leaves PathMemory instances behind in the memory. As soon as we cleared the memory explicitly by calling session.getNodeMemories().clear() after every session.reset() the rules fired again as usual. So we are wondering if the current implementation of session.reset() is incomplete.
We are aware that session.reset() is an internal method. However this issue should also affect the session cache feature of Drools. At the same time it would be nice to have a public interface to session.reset() since in our application reusing a session is beneficial but we don't need the session cache as we can easily remember the last session which we used for processing and it seems more straightforward to just bring that one back to life instead of storing and retrieving it from a cache.