[
https://issues.apache.org/jira/browse/CURATOR-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13674671#comment-13674671
]
Ioannis Canellos commented on CURATOR-14:
-----------------------------------------
> I wonder if we could hide the WatcherMap altogether inside of Curator. Extend
> with usingWatcher() semantics to take a WatcherKey instance.
This would be great. I've experimented with this approach, between the drafts.
The problem I run into is that if we have the recipes being completely
WatcherMap agnostic, then we can't benefit from close/stop methods that most
recipes have and are a good place for returning the "Watcher" back to the pool.
So we would have to rely on releasing the Watcher only when fired and I am not
sure if this is ideal. An other approach would be to have some short of
lifecycle methods on the "WatcherKey" that we could use to release the watcher
without referencing the WatcherMap.
> Memory leak in Curator watches
> ------------------------------
>
> Key: CURATOR-14
> URL: https://issues.apache.org/jira/browse/CURATOR-14
> Project: Apache Curator
> Issue Type: New Feature
> Components: Recipes
> Affects Versions: 2.0.0-incubating
> Reporter: Brandon Beck
> Priority: Minor
> Attachments: CURATOR-14-draft-2.patch, CURATOR-14-draft-3.patch,
> CURATOR-14.patch, MemoryTest.java
>
>
> The JVM runs out of memory if you repetitively create a PathChildrenCache,
> start it then immediately stop it. It appears that the memory is taken up by
> a watch that isn't ever cleaned up. Curator attempts to do some pooling of
> watches, but doesn't seem to use the path in the pooling.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira