jira-importer commented on issue #535:
URL: https://github.com/apache/curator/issues/535#issuecomment-2604692422

   <i><a 
href="https://issues.apache.org/jira/secure/ViewProfile.jspa?name=iocanel";>iocanel</a>:</i>
   <p>Apparently there is something I am missing here :-D</p>
   
   <p>So the main problem is that there is no way to clear a Watcher that has 
been assigned to ZooKeeper. <br/>
   Eventually this can lead to a memory leak since its not possible to garbage 
collect Watcher instances.<br/>
   In order to workaround this problem we should limit the amount of Watchers 
we create and reuse Watcher instances when its possible.</p>
   
   <p>Currently curator is using Guava's cache that uses "weak values" so that 
values can be garbage collected (once they are weakly reachable). This is done 
transparently whenever we call usingWatcher via Watching.</p>
   
   <p>There are a couple of things that I don't understand here:</p>
   
   <p>i) If using "guava's cache" was enough, then what is to be implemented 
for this issue? The cache is already in place and is already being used in a 
transparent way.<br/>
   ii) Does the garbage collector ever manage to collect values of the cache, 
given that they are not cleared in ZooKeeper? From some tests I run using a 
modified version of the attached MemoryTest I don't see any value getting 
garbage collected.</p>
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@curator.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to