[jboss-jira] [JBoss JIRA] (AS7-3736) javax.el.BeanELResolver.properties keeps references to undeployed classes (Class Loader leak)

Remy Maucherat (JIRA) jira-events at lists.jboss.org
Thu Aug 2 03:50:07 EDT 2012


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

Remy Maucherat commented on AS7-3736:
-------------------------------------

Yes, I saw the pull request. Thanks !
It could have been placed in the web container code, but it's probably not the right place (the API impl is not located there).
                
> javax.el.BeanELResolver.properties keeps references to undeployed classes (Class Loader leak)
> ---------------------------------------------------------------------------------------------
>
>                 Key: AS7-3736
>                 URL: https://issues.jboss.org/browse/AS7-3736
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: EE
>    Affects Versions: 7.1.0.CR1b
>         Environment: Seam 2.2.2 application
>            Reporter: Philippe Guinot
>            Assignee: Stuart Douglas
>              Labels: BeanELResolver, classloader, leak,, memory
>
> This is another Class Loader leak memory issue. When class are loaded into the properties map, they don't get unloaded at undeploy. This cause the whole application's class loader not being garbage collected and so will result in OutOfMemoryError: PermGen space after a few deployments.
> The solution would be to call the purgeBeanClasses method at undeploy with each of the class loader of all sub-modules of the application.
> For the moment, the work around I've done was to change
> {code}private static final ConcurrentHashMap<Class, BeanProperties> properties =
>          new ConcurrentHashMap<Class, BeanProperties>(CACHE_SIZE);
> {code}to{code}
> private static final Map<Class<?>, SoftReference<BeanProperties>> properties =
>          Collections.synchronizedMap(new WeakHashMap<Class<?>, SoftReference<BeanProperties>>(CACHE_SIZE));
> {code}
> But I'm not really sure if that's a good idea to replace the ConcurrentHashMap with a SynchronizedMap and I had to change
> {code}properties.putIfAbsent(baseClass, bps);{code}
> By{code}
> synchronized(properties) {
>     if (!properties.containsKey(baseClass))
>         properties.put(baseClass, new SoftReference<BeanProperties>(bps));
> }
> {code}

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