[jboss-jira] [JBoss JIRA] (DROOLS-35) Possible memory leak: MarshallerReaderContext held indefinitely by ReteooStatefulSession

RH Bugzilla Integration (JIRA) jira-events at lists.jboss.org
Thu Aug 8 08:14:26 EDT 2013


    [ https://issues.jboss.org/browse/DROOLS-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795762#comment-12795762 ] 

RH Bugzilla Integration commented on DROOLS-35:
-----------------------------------------------

Mario Fusco <mfusco at redhat.com> made a comment on [bug 995017|https://bugzilla.redhat.com/show_bug.cgi?id=995017]

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();
                
> Possible memory leak: MarshallerReaderContext held indefinitely by ReteooStatefulSession
> ----------------------------------------------------------------------------------------
>
>                 Key: DROOLS-35
>                 URL: https://issues.jboss.org/browse/DROOLS-35
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.0.Final
>         Environment: Oracle JDK7
>            Reporter: Magnus Vojbacke
>            Assignee: Mario Fusco
>             Fix For: 5.5.1.Final, 6.0.0.Alpha9
>
>
> It seems that the memory consumption increases after a session has been unmarshalled. That is to say: an unmarshalled session of size x uses  much more memory than if I had started with an empty session and inserted x number of facts.
> Digging into a memory profile, I found that after unmarshalling, my ReteooStatefulSession instance holds on to a MarshallerReaderContext instance: 
> StatefulKnowledgeSessionImpl : session
> ReteooStatefulSession : defaultEntryPoint
> NamedEntryPoint : objectStore
> SingleThreadedObjectStore : identityMap
> ObjectHashMap : table
> Entry[] : [0]
> ObjectHashMap$ObjectEntry : value
> DefaultFactHandle : lastLeftTuple
> RuleTerminalNodeLeftTuple : object
> AgendaItem : context
> PropagationContextImpl : readerContext
> MarshallerReaderContext : this 
> The MarshallerReaderContext consumes a lot of memory.
> Digging into the unmarshalling code, it seems that the MarshallerReaderContext is a utility class used during unmarshalling of sessions. Intuitively, it seems wrong that a reference to this object should be held after unmarshalling is finished.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list