Return-Path: X-Original-To: apmail-curator-dev-archive@minotaur.apache.org Delivered-To: apmail-curator-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5126518C4A for ; Mon, 11 Jan 2016 12:42:40 +0000 (UTC) Received: (qmail 69597 invoked by uid 500); 11 Jan 2016 12:42:40 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 69550 invoked by uid 500); 11 Jan 2016 12:42:40 -0000 Mailing-List: contact dev-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list dev@curator.apache.org Received: (qmail 69536 invoked by uid 99); 11 Jan 2016 12:42:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jan 2016 12:42:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CD3D72C1F5C for ; Mon, 11 Jan 2016 12:42:39 +0000 (UTC) Date: Mon, 11 Jan 2016 12:42:39 +0000 (UTC) From: "Joe Littlejohn (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CURATOR-286) Memory leak in service discovery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CURATOR-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Littlejohn updated CURATOR-286: ----------------------------------- Description: 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. was: 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 (and this refers to the the PathChildrenCache. > 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 > Priority: Critical > 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)