[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 15:56:01 EST 2012


     [ https://issues.jboss.org/browse/AS7-3734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Marlow updated AS7-3734:
------------------------------

       Fix Version/s: 7.1.0.Final
    Git Pull Request: https://github.com/jbossas/jboss-as/pull/1506  (was: https://github.com/jbossas/jboss-as/pull/1506)
     Forum Reference: https://community.jboss.org/thread/195134  (was: https://community.jboss.org/thread/195134)

    
> 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
>             Fix For: 7.1.0.Final
>
>
> 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