zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Zillmann <jzillm...@googlemail.com>
Subject garbage collection of ZooKeeper class
Date Mon, 14 Feb 2011 08:39:27 GMT
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...

View raw message