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

ASF GitHub Bot commented on CURATOR-477:
----------------------------------------

GitHub user ramaraochavali opened a pull request:

    https://github.com/apache/curator/pull/278

    [CURATOR-477] added support for turning off zk watches

    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.
    
    In this PR, Made the createZkWatches configurable in the Builder, so that 
use cases like ours can set it to false. The default is true, retaining the 
current behaviour.
    Fixes the jira issue https://issues.apache.org/jira/browse/CURATOR-477

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ramaraochavali/curator CURATOR-477

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/278.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #278
    
----
commit d4a0d95488345bfb0983553bfbfbc40643ac031b
Author: Rama <rama.rao@...>
Date:   2018-08-20T06:46:12Z

    added support for zkwatches

----


> 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