You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Joe Littlejohn (JIRA)" <ji...@apache.org> on 2016/01/11 19:32:39 UTC
[jira] [Commented] (CURATOR-286) Memory leak in service discovery
[ https://issues.apache.org/jira/browse/CURATOR-286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15092440#comment-15092440 ]
Joe Littlejohn commented on CURATOR-286:
----------------------------------------
Thanks for the info Jordan! I guess this means that the only safe way to use the service discovery recipe in Curator 2.x is to cache the service provider? It might be good to have a prominent warning somewhere to this effect.
> Memory leak in service discovery
> --------------------------------
>
> Key: CURATOR-286
> URL: https://issues.apache.org/jira/browse/CURATOR-286
> Project: Apache Curator
> Issue Type: Bug
> Components: Recipes
> Affects Versions: 2.9.1
> Reporter: Joe Littlejohn
> Assignee: Jordan Zimmerman
> Priority: Critical
> Fix For: 3.0.0
>
> Attachments: ServiceCacheLeakTester.java, curator-286.hprof.tar.gz
>
>
> Hi
> I'm seeing a memory leak in my application which makes use of service discovery.
> I've taken heap dumps and I see:
> * Hundreds of thousands of NamespaceWatcher instances. The client, actualWatcher and curatorWatcher fields are all null, so these are closed NamespaceWatchers.
> * Thousands of PathChildrenCache instances. Each one has a 'path' value that refers to one of the services I'm lookup up (using a service provider). The state fields shows that all these PathChildrenCache instances are CLOSED.
> In my application I'm using a service provider to get an instance, then closing that service provider. It seems that even after doing this, there's still a reference to the NamespaceWatcher held in ZKWatchManager field childWatches.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)