zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ChaoWang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ZOOKEEPER-3131) org.apache.zookeeper.server.WatchManager resource leak
Date Tue, 28 Aug 2018 08:33:00 GMT
ChaoWang created ZOOKEEPER-3131:

             Summary: org.apache.zookeeper.server.WatchManager resource leak
                 Key: ZOOKEEPER-3131
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3131
             Project: ZooKeeper
          Issue Type: Bug
          Components: server
    Affects Versions: 3.5.4, 3.5.3
         Environment: -Xmx512m 
            Reporter: ChaoWang

In some cases, the variable _watch2Paths_ in _Class WatchManager_ does not remove the entry,
even if the associated value "HashSet" is empty already. 

The type of key in Map _watch2Paths_ is Watcher, instance of _NettyServerCnxn._ If it is
not removed when the associated set of paths is empty, it will cause the memory increases
little by little, and OutOfMemoryError triggered finally. 


In the following function, the logic should be added to remove the entry.

org.apache.zookeeper.server.WatchManager#removeWatcher(java.lang.String, org.apache.zookeeper.Watcher)

if (paths.isEmpty()) {

For the following function as well:

org.apache.zookeeper.server.WatchManager#triggerWatch(java.lang.String, org.apache.zookeeper.Watcher.Event.EventType,


Please confirm this issue?

This message was sent by Atlassian JIRA

View raw message