Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4686

ClassLoader leak with RmiRegistryFactory and sun.rmi.transport.tcp.TCPEndpoint

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.4, 4.0.6, 3.0.8
    • Fix Version/s: 4.1.0, 4.0.7
    • Component/s: None
    • Labels:
      None

      Description

      Here's a leak I found in JVisualVM.

      this     - value: org.apache.felix.framework.BundleWiringImpl #3
       <- m_wiring     - class: org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5, value: org.apache.felix.framework.BundleWiringImpl #3
        <- <classLoader>     - class: org.apache.karaf.management.RmiRegistryFactory$KarafServerSocketFactory, value: org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 #3
         <- <class>     - class: org.apache.karaf.management.RmiRegistryFactory$KarafServerSocketFactory, value: org.apache.karaf.management.RmiRegistryFactory$KarafServerSocketFactory class RmiRegistryFactory$KarafServerSocketFactory
          <- ssf     - class: sun.rmi.transport.tcp.TCPEndpoint, value: org.apache.karaf.management.RmiRegistryFactory$KarafServerSocketFactory #1
           <- key     - class: java.util.HashMap$Entry, value: sun.rmi.transport.tcp.TCPEndpoint #9
            <- next     - class: java.util.HashMap$Entry, value: java.util.HashMap$Entry #19809
             <- [0]     - class: java.util.HashMap$Entry[], value: java.util.HashMap$Entry #28136
              <- table     - class: java.util.HashMap, value: java.util.HashMap$Entry[] #4031
               <- localEndpoints (sticky class)     - class: sun.rmi.transport.tcp.TCPEndpoint, value: java.util.HashMap #4065
      

      sun.rmi.transport.tcp.TCPEndpoint has non-weak map that keeps references to socket factories: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/48c99b423839/src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java#l148

      This prevents cleaning up classloader of org.apache.karaf.management.server bundle.

        Attachments

          Activity

            People

            • Assignee:
              gnt Guillaume Nodet
              Reporter:
              gzres Grzegorz Grzybek
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: