[jboss-jira] [JBoss JIRA] (AS7-3734) HibernateAnnotationScanner keeps references to application's ClassLoader

Scott Marlow (JIRA) jira-events at lists.jboss.org
Mon Feb 13 11:35:01 EST 2012


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

Scott Marlow commented on AS7-3734:
-----------------------------------

Stepping through the cleanup code, while running unit test org.jboss.as.test.integration.jpa.dsrestart.JpaDsRestartTestCase, looks good (both collections get cleaned up correctly with the above mentioned change).
                
> HibernateAnnotationScanner keeps references to application's ClassLoader
> ------------------------------------------------------------------------
>
>                 Key: AS7-3734
>                 URL: https://issues.jboss.org/browse/AS7-3734
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: JPA / Hibernate
>    Affects Versions: 7.1.0.CR1b
>         Environment: Seam 2.2.2 application using JPA/Hibernate 3
>            Reporter: Philippe Guinot
>            Assignee: Scott Marlow
>              Labels: PersistenceUnitMetadata, class, classloader, leak
>
> Well, this is a minor issue as the references are kept in WeakHashMaps. Indeed, the HibernateAnnotationScanner contains static weak maps of the Package/Classes of the current application. They are indexed by PersistenceUnitMetadata.
> When the application gets undeployed the PersistenceUnitMetadata is no longer referenced, and should be garbage collected. However the value of the WeahHashMap won't be removed until the next expunging is done. As the application has been undeployed, it does not really make sense to keep strong references to the classes or packages. So, using Set<WeakReference<Package>> and Set<WeakReference<Class<?>>> would improve garbage collecting of the application's class loader and make more PermGen easily available.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list