curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ioannis Canellos (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CURATOR-14) Memory leak in Curator watches
Date Tue, 07 May 2013 13:45:15 GMT

     [ https://issues.apache.org/jira/browse/CURATOR-14?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ioannis Canellos updated CURATOR-14:
------------------------------------

    Attachment: CURATOR-14-draft-2.patch

I am attaching a second draft of the patch.

There are still things need to be done, but I'd like some feedback/guidelines.

The patch modifies the NamespaceWatcherMap and adds it some pooling characteristics (a borrow
and release method backed by an array list).

The main issue I have is when to "borrow" and when to "release":

i) Having the recipes do the "borrow" and "release" in some cases is not enough as not always
is obvious when to "release". 
ii) Releasing when the watcher processes the event again is not enough, as I think that curator
may reuse Watcher instance again in some cases (not 100% sure).
iii) "borrow" inside the Watching getWatcher() seems like a good idea but then again its not
easy to "release".

Thoughts?

                
> 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
>            Assignee: Jordan Zimmerman
>            Priority: Minor
>         Attachments: CURATOR-14-draft-2.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

Mime
View raw message