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

RH Bugzilla Integration (JIRA) issues at jboss.org
Thu May 28 05:23:03 EDT 2015


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

RH Bugzilla Integration commented on AS7-3736:
----------------------------------------------

Vaclav Tunka <vtunka at redhat.com> changed the Status of [bug 1207583|https://bugzilla.redhat.com/show_bug.cgi?id=1207583] from NEW to ON_QA

> 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
>             Fix For: 7.1.3.Final (EAP), EAP 6.1.0.Alpha (7.2.0.Final)
>
>
> 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 was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list