[jboss-jira] [JBoss JIRA] (WFLY-9849) Hibernate session related leak on module undeployment

Scott Marlow (JIRA) issues at jboss.org
Fri Jun 1 11:04:00 EDT 2018


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

Scott Marlow commented on WFLY-9849:
------------------------------------

I opened wildfly-leak-2.hprof and verified that there is no leak, I just had forgotten to verify that the suspected leaks had strong references to them.  

In summary, having four org.hibernate.internal.SessionFactoryImpl instances in memory is correct, as three of them are only have *weak* references to them (will be garbage collected eventually).

One difference between Hibernate 5.3.1.Final and earlier Hibernate versions, is that 5.3.1.Final defaults to using ByteBuddy for enhancing entity classes, instead of Javassist.  Which probably has something to do with why with 5.3.1, I don't see any weak references to the undeployed (org.hibernate.internalSessionFactoryImpl) test app.  

Hope this helps you, I'm closing this issue as not a bug.  Thank you for reporting it and providing the needed information to verify, that there is no leak. :)

Scott

> Hibernate session related leak on module undeployment
> -----------------------------------------------------
>
>                 Key: WFLY-9849
>                 URL: https://issues.jboss.org/browse/WFLY-9849
>             Project: WildFly
>          Issue Type: Bug
>    Affects Versions: 11.0.0.Final, 12.0.0.Final
>         Environment: * Ubuntu 16.04.3 LTS
> * OpenJDK 1.8.0_151
> * Wildfly 11.0.0.Final
> Seems to occur at least on CentOS 7/OpenJDK 1.8.0_151 also.
>            Reporter: Joni Syri
>            Assignee: Scott Marlow
>
> In some cases it seems that removing deployment from the Wildfly, doesn't free up {{org.hibernate.internal.SessionFactoryImpl}}- instance related to the deployment. (plus some other Hibernate related classes). This can be seen by taking memory dump with VisualVM and looking up {{SessionFactoryImpl}} instances. 
> This leads to cumulative memory leak in cases, where application is repeatedly deployed/undeployed (or updated).
> updated: Seems to occur on 12.0.0.Final also
> Memory dumps can be found at https://drive.google.com/drive/folders/1WbHB6hRpr_lrc4yb4yxWLpeObmJlNCzD (wildfly-leak-1 is after first deployment, wildfly-leak-2 after few re-deploys)
> server.log https://drive.google.com/file/d/1I32OTnPWeopVEtRC3ol-pjkH2dlkLizD/view?usp=sharing



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list