[ 
https://issues.apache.org/jira/browse/CURATOR-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16625212#comment-16625212
 ] 

Jordan Zimmerman commented on CURATOR-477:
------------------------------------------

{quote}There is an interesting framework level issue he brings up about leaking 
ZK watches in the framework.  Is that legit?  TreeCache does try to clean up 
after itself and remove watchers from the framework.
{quote}
I believe the issue is that any previous watches stay set if a different 
watcher instance is set for the same path. When Curator was written it wasn't 
possible to remove watchers. We could think about how to handle it in the 
framework better but it's not simple.

> Ability to turn off Zk Watches in Curator Framework
> ---------------------------------------------------
>
>                 Key: CURATOR-477
>                 URL: https://issues.apache.org/jira/browse/CURATOR-477
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 4.0.1
>            Reporter: Rama Chavali
>            Priority: Major
>
> In our use case, we use *{{TreeCache}}* to get Zk Data periodically. We start 
> *{{TreeCache}}* read data and close it. In this use case, The 
> {{ZkWatchManager}} of {{ZooKeeper}} class keeps growing for every TreeCache 
> operation because new {{TreeNode}} objects are created and added there 
> leading to a memory leak. Also since we do not want the Watcher to 
> periodically watch, this creates unnecessary background operations.
> Can we introduce a builder flag in CuratorFramework's Builder some thing 
> called "createZkWatches" that we can use to turn the watchers off? The 
> default would be set to true to retain the current behaviour.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to