You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Ioannis Canellos (JIRA)" <ji...@apache.org> on 2013/05/03 01:06:17 UTC

[jira] [Comment Edited] (CURATOR-14) Memory leak in Curator watches

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

Ioannis Canellos edited comment on CURATOR-14 at 5/2/13 11:05 PM:
------------------------------------------------------------------

A first draft.

The patch adds the WatcherCache interface with a default implementation the NamespaceWatcherCache (used to be NamespaceWatcherMap). The cache is expose by the client as Jason described.

Recipes have been tuned to use the WatcherCache where it makes sense.

Tested against the attached case and it solves the memory leak.

This implementation of course still has issues when multiple instances of the same recipe are used. Need to work on that more.
                
      was (Author: iocanel):
    A first draft.

The patch adds the WatcherCache interface with a default implementation the NamespaceWatcherCache (used to be NamespaceWatcherMap). The cache is expose by the client as Jason described.

Recipes have been tuned to use the WatcherCache where it makes sense.

Tested against the attached case and it solves the memory leak.
                  
> 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
>            Reporter: Brandon Beck
>            Assignee: Jordan Zimmerman
>            Priority: Minor
>         Attachments: 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