Return-Path: Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: (qmail 78880 invoked from network); 14 Feb 2011 23:42:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Feb 2011 23:42:13 -0000 Received: (qmail 56553 invoked by uid 500); 14 Feb 2011 23:42:13 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 56419 invoked by uid 500); 14 Feb 2011 23:42:12 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 56411 invoked by uid 99); 14 Feb 2011 23:42:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 23:42:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 14 Feb 2011 23:42:09 +0000 Received: (qmail 78739 invoked by uid 99); 14 Feb 2011 23:41:48 -0000 Received: from localhost.apache.org (HELO mail-iw0-f170.google.com) (127.0.0.1) (smtp-auth username phunt, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 23:41:48 +0000 Received: by iwn6 with SMTP id 6so7108094iwn.15 for ; Mon, 14 Feb 2011 15:41:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.227.4 with SMTP id iy4mr5813408icb.226.1297726907320; Mon, 14 Feb 2011 15:41:47 -0800 (PST) Received: by 10.42.174.193 with HTTP; Mon, 14 Feb 2011 15:41:47 -0800 (PST) In-Reply-To: <64C41D6A-C615-4CF0-B8C6-E8E4154AD0DD@googlemail.com> References: <64C41D6A-C615-4CF0-B8C6-E8E4154AD0DD@googlemail.com> Date: Mon, 14 Feb 2011 15:41:47 -0800 Message-ID: Subject: Re: garbage collection of ZooKeeper class From: Patrick Hunt To: user@zookeeper.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Ok, great! Patrick On Mon, Feb 14, 2011 at 1:23 PM, Johannes Zillmann wrote: > Hi Patrick, > > On Feb 14, 2011, at 6:36 PM, Patrick Hunt wrote: > >> What version are you using? Perhaps you are hitting this one? >> https://issues.apache.org/jira/browse/ZOOKEEPER-795 > > Looks like this is the case, at least i couldn't reproduce the problem after upgrading from 3.3.1 to 3.3.2. > Thanks ! > Johannes > > >> >> You might try doing a stack dump (jstack) on the client to determine >> if leaking threads might be the cause. >> >> Patrick >> >> On Mon, Feb 14, 2011 at 12:39 AM, Johannes Zillmann >> wrote: >>> Dear folks, >>> >>> i'm currently debugging a possible-memory leak in an application which uses zookeeper. >>> I found ZooKeeper$ZkWatchManager.existWatches growing large - probably a usage problem. >>> >>> However i'm running a small test app in loop a session expiration happens from time to time. >>> On an expired event the app closes the current ZooKeeper instance on and creates a new instance of it. >>> What i found out through debugging is that the number of ZooKeeper instances in the system is constantly growing, with most instances in state CLOSED. >>> Forcing GC doesn't change anything here. Looking at the references it i seems like a closed ZooKeeper instance is only referenced by a ClientCnxn, and this ClientCnxn is referenced only bye a ZooKeeper + Send- and Event-thread. >>> So i suspect this reference cycle prevents the garbage collection... >>> >>> Johannes > >