You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/31 15:58:20 UTC

[jira] [Commented] (KARAF-4686) ClassLoader leak with RmiRegistryFactory and sun.rmi.transport.tcp.TCPEndpoint

    [ https://issues.apache.org/jira/browse/KARAF-4686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15452616#comment-15452616 ] 

ASF GitHub Bot commented on KARAF-4686:
---------------------------------------

GitHub user grgrzybek opened a pull request:

    https://github.com/apache/karaf/pull/233

    [KARAF-4686] Cleaning sun.rmi.transport.tcp.TCPEndpoint.localEndpoint…

    …s cache

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/grgrzybek/karaf master-KARAF-4686

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/karaf/pull/233.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #233
    
----
commit c341c759ac4b955c2686950af91e4f8307711d7a
Author: Grzegorz Grzybek <gg...@redhat.com>
Date:   2016-08-31T15:49:30Z

    [KARAF-4686] Cleaning sun.rmi.transport.tcp.TCPEndpoint.localEndpoints cache

----


> ClassLoader leak with RmiRegistryFactory and sun.rmi.transport.tcp.TCPEndpoint
> ------------------------------------------------------------------------------
>
>                 Key: KARAF-4686
>                 URL: https://issues.apache.org/jira/browse/KARAF-4686
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 2.4.4, 4.0.6, 3.0.8
>            Reporter: Grzegorz Grzybek
>
> Here's a leak I found in JVisualVM.
> {noformat}
> 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
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)