Bug 995017

Summary: Memory leak: MarshallerReaderContext held indefinitely by ReteooStatefulSession
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Mario Fusco <mfusco>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: VERIFIED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: nwallace
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 986451    
Attachments:
Description Flags
Simple Maven based reproducer
none
Screenshot of VisualVM heap dump view comparing 5.3.1-P03 and P04 none

Description Mario Fusco 2013-08-08 12:12:31 UTC
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();

Comment 2 Petr Široký 2013-09-13 15:41:47 UTC
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.

Comment 3 Petr Široký 2013-09-13 15:43:23 UTC
Created attachment 797401 [details]
Simple Maven based reproducer

Comment 4 Petr Široký 2013-09-13 15:44:11 UTC
Created attachment 797402 [details]
Screenshot of VisualVM heap dump view comparing 5.3.1-P03 and P04