Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-4868

cglib ThreadLocal causing ClassLoader memory leak

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.1.5, 2.2, 3.0.0
    • Component/s: None
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      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:

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

        Activity

        Hide
        kevan Kevan Miller added a comment -

        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.

        Show
        kevan Kevan Miller added a comment - 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.

          People

          • Assignee:
            kevan Kevan Miller
            Reporter:
            kevan Kevan Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development