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

Philippe Guinot (JIRA) jira-events at lists.jboss.org
Mon Feb 13 08:46:01 EST 2012


Philippe Guinot created AS7-3734:
------------------------------------

             Summary: 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


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