You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Kevan Miller (JIRA)" <ji...@apache.org> on 2009/09/13 17:55:57 UTC

[jira] Created: (GERONIMO-4868) cglib ThreadLocal causing ClassLoader memory leak

cglib ThreadLocal causing ClassLoader memory leak
-------------------------------------------------

                 Key: GERONIMO-4868
                 URL: https://issues.apache.org/jira/browse/GERONIMO-4868
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
    Affects Versions: 2.1.4
            Reporter: Kevan Miller
            Assignee: Kevan Miller
             Fix For: 2.1.5, 2.2


ghostknife reported an OOME PermGen failure during a redeploy of an app. I took at the .hprof file generated on an OOME when -XX:+HeapDumpOnOutOfMemoryError is set.

One leak is caused by the following:

{code}
Class Name                                                                                                               | Shallow Heap | Retained Heap 
--------------------------------------------------------------------------------------------------------------------------------------------------------
org.apache.geronimo.kernel.config.MultiParentClassLoader @ 0xac80f258                                                    |           96 |        13,896 
|- parent org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader @ 0xac80f470                                |           72 |           720 
|  '- [1] java.lang.ClassLoader[10] @ 0xac813d18                                                                         |           56 |           776 
|     '- parents org.apache.geronimo.kernel.config.MultiParentClassLoader @ 0xac812f88                                   |           96 |         7,304 
|        '- <classloader> class org.apache.geronimo.management.geronimo.WebModule$$EnhancerByCGLIB$$aaa027b5 @ 0xb1bd48a8|          432 |         8,784 
|           '- proxyType org.apache.geronimo.kernel.basic.ProxyMethodInterceptor @ 0xac849258                            |           24 |        46,904 
|              '- [0] net.sf.cglib.proxy.Callback[1] @ 0xac846ce8                                                        |           16 |        46,920 
|                 '- value java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0xac844080                                       |           32 |        46,952 
|                    '- [8] java.lang.ThreadLocal$ThreadLocalMap$Entry[64] @ 0xac7c80b0                                  |          272 |       106,984 
|                       '- table java.lang.ThreadLocal$ThreadLocalMap @ 0xac730ba8                                       |           24 |       107,008 
|                          '- threadLocals java.lang.Thread @ 0xac726f80  DefaultThreadPool 1 Thread                     |           88 |       107,584 
--------------------------------------------------------------------------------------------------------------------------------------------------------
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (GERONIMO-4868) cglib ThreadLocal causing ClassLoader memory leak

Posted by "Rex Wang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rex Wang closed GERONIMO-4868.
------------------------------


> cglib ThreadLocal causing ClassLoader memory leak
> -------------------------------------------------
>
>                 Key: GERONIMO-4868
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4868
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.4
>            Reporter: Kevan Miller
>            Assignee: Kevan Miller
>             Fix For: 2.1.5, 2.2, 3.0
>
>
> ghostknife reported an OOME PermGen failure during a redeploy of an app. I took at the .hprof file generated on an OOME when -XX:+HeapDumpOnOutOfMemoryError is set.
> One leak is caused by the following:
> {code}
> Class Name                                                                                                               | Shallow Heap | Retained Heap 
> --------------------------------------------------------------------------------------------------------------------------------------------------------
> org.apache.geronimo.kernel.config.MultiParentClassLoader @ 0xac80f258                                                    |           96 |        13,896 
> |- parent org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader @ 0xac80f470                                |           72 |           720 
> |  '- [1] java.lang.ClassLoader[10] @ 0xac813d18                                                                         |           56 |           776 
> |     '- parents org.apache.geronimo.kernel.config.MultiParentClassLoader @ 0xac812f88                                   |           96 |         7,304 
> |        '- <classloader> class org.apache.geronimo.management.geronimo.WebModule$$EnhancerByCGLIB$$aaa027b5 @ 0xb1bd48a8|          432 |         8,784 
> |           '- proxyType org.apache.geronimo.kernel.basic.ProxyMethodInterceptor @ 0xac849258                            |           24 |        46,904 
> |              '- [0] net.sf.cglib.proxy.Callback[1] @ 0xac846ce8                                                        |           16 |        46,920 
> |                 '- value java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0xac844080                                       |           32 |        46,952 
> |                    '- [8] java.lang.ThreadLocal$ThreadLocalMap$Entry[64] @ 0xac7c80b0                                  |          272 |       106,984 
> |                       '- table java.lang.ThreadLocal$ThreadLocalMap @ 0xac730ba8                                       |           24 |       107,008 
> |                          '- threadLocals java.lang.Thread @ 0xac726f80  DefaultThreadPool 1 Thread                     |           88 |       107,584 
> --------------------------------------------------------------------------------------------------------------------------------------------------------
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (GERONIMO-4868) cglib ThreadLocal causing ClassLoader memory leak

Posted by "Kevan Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/GERONIMO-4868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevan Miller resolved GERONIMO-4868.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0

I updated BasicProxyManager.createProxy() to call Enhancer.registerCallbacks(proxyType, null). From documentation, this should clear out the ThreadLocal created by cglib. I took a look at cglib source, but wasn't able to figure out how this worked, however. 

> cglib ThreadLocal causing ClassLoader memory leak
> -------------------------------------------------
>
>                 Key: GERONIMO-4868
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4868
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.1.4
>            Reporter: Kevan Miller
>            Assignee: Kevan Miller
>             Fix For: 2.1.5, 2.2, 3.0
>
>
> ghostknife reported an OOME PermGen failure during a redeploy of an app. I took at the .hprof file generated on an OOME when -XX:+HeapDumpOnOutOfMemoryError is set.
> One leak is caused by the following:
> {code}
> Class Name                                                                                                               | Shallow Heap | Retained Heap 
> --------------------------------------------------------------------------------------------------------------------------------------------------------
> org.apache.geronimo.kernel.config.MultiParentClassLoader @ 0xac80f258                                                    |           96 |        13,896 
> |- parent org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader @ 0xac80f470                                |           72 |           720 
> |  '- [1] java.lang.ClassLoader[10] @ 0xac813d18                                                                         |           56 |           776 
> |     '- parents org.apache.geronimo.kernel.config.MultiParentClassLoader @ 0xac812f88                                   |           96 |         7,304 
> |        '- <classloader> class org.apache.geronimo.management.geronimo.WebModule$$EnhancerByCGLIB$$aaa027b5 @ 0xb1bd48a8|          432 |         8,784 
> |           '- proxyType org.apache.geronimo.kernel.basic.ProxyMethodInterceptor @ 0xac849258                            |           24 |        46,904 
> |              '- [0] net.sf.cglib.proxy.Callback[1] @ 0xac846ce8                                                        |           16 |        46,920 
> |                 '- value java.lang.ThreadLocal$ThreadLocalMap$Entry @ 0xac844080                                       |           32 |        46,952 
> |                    '- [8] java.lang.ThreadLocal$ThreadLocalMap$Entry[64] @ 0xac7c80b0                                  |          272 |       106,984 
> |                       '- table java.lang.ThreadLocal$ThreadLocalMap @ 0xac730ba8                                       |           24 |       107,008 
> |                          '- threadLocals java.lang.Thread @ 0xac726f80  DefaultThreadPool 1 Thread                     |           88 |       107,584 
> --------------------------------------------------------------------------------------------------------------------------------------------------------
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.