After running some code like the code below, get a memory snapshot from the JVM. Note that it still holds a MarshallerReaderContext instance as a member of the ReteooStatefulSession instance. -- Marshall/unmarshall code //kBase = KnowledgeBaseFactory.newKnowledgeBase(...); //kBase.addKnowledgePackages(kps); //session = kBase.newStatefulKnowledgeSession(config, null); //Insert some facts // Marshall a session Marshaller marshaller = MarshallerFactory.newMarshaller(session.getKnowledgeBase()); marshaller.marshall(bOut, session); bOut.close(); // Restart the jvm if you like // session = new session //Unmarshall the session Marshaller marshaller = MarshallerFactory.newMarshaller(session.getKnowledgeBase()); marshaller.unmarshall(bIn, session); bIn.close();
Fixed by https://github.com/droolsjbpm/drools/commit/8a897117faa3dcd578cac638bb3fd2f8ba07ffeb
Verified that the reference to MarshallerReaderContext is not held anymore. Attaching screenshot from VisualVM that clearly shows it and also Maven based reproducer I used.
Created attachment 797401 [details] Simple Maven based reproducer
Created attachment 797402 [details] Screenshot of VisualVM heap dump view comparing 5.3.1-P03 and P04