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 601191152D for ; Thu, 15 May 2014 06:32:05 +0000 (UTC) Received: (qmail 20581 invoked by uid 500); 14 May 2014 14:35:15 -0000 Delivered-To: apmail-curator-dev-archive@curator.apache.org Received: (qmail 19749 invoked by uid 500); 14 May 2014 14:35:15 -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 19577 invoked by uid 99); 14 May 2014 14:35:15 -0000 Received: from Unknown (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2014 14:35:15 +0000 Date: Wed, 14 May 2014 14:35:15 +0000 (UTC) From: "Jordan Zimmerman (JIRA)" To: dev@curator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CURATOR-105) Memory leak when using PathChildrenCache 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-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13997592#comment-13997592 ] Jordan Zimmerman commented on CURATOR-105: ------------------------------------------ I've done some work on this, but there's more to do. The first problem is that Curator's internal Watcher map is holding on to references. My current attempt at a fix is to add CuratorFramework.clearWatcherReferences(). My testing shows this clears most of the references. However, Guava's cache seems to be holding onto additional references that I haven't figured out yet. Please have a look at the branch CURATOR-105 and see if you can help on this. > Memory leak when using PathChildrenCache > ---------------------------------------- > > Key: CURATOR-105 > URL: https://issues.apache.org/jira/browse/CURATOR-105 > Project: Apache Curator > Issue Type: Bug > Components: Framework, Recipes > Affects Versions: 2.4.1, 2.4.2 > Environment: Java(TM) SE Runtime Environment (build 1.7.0_55-b13) > Reporter: Joe Littlejohn > Assignee: Jordan Zimmerman > Labels: discovery > Fix For: 2.5.0 > > Attachments: ServiceCacheLeakTest.java > > > I've observed a memory leak in our production system using Curator service discovery. > If you run the attached test case and watch the process with jvisualvm you'll see that the heap grows and grows as the test is running. Taking a heap dump will reveal thousands of ServiceInstance and ServiceCacheImpl instances that are retained even though the provider is closed after each usage. The references appear to be traced back to the PathChildrenCache. This appears to be a leak that shouldn't occur if the provider is correctly closed each time. > There is also a heap dump available here: > https://dl.dropboxusercontent.com/u/10909453/heapdump-curator-leak.hprof.tar.gz -- This message was sent by Atlassian JIRA (v6.2#6252)