Skip to content

Memory leak in PersistentWatcher introduced in PR #520 #1292

@vreuland

Description

@vreuland

Hello,

I have moved to Apache Curator 5.9 recently (from 5.6) and I have observed a memory leak using that new version.
Checking using a heap dump, the leak is clearly coming from PersistentWatcher which is registering a listener on Curator and that listener is not properly removed when the PersistentWatcher is closed.
In this example, I have 1524 registered PersistentWatcher "owned" listeners, a very big majority of them being listeners from PersistentWatcher instances long gone (closed) and discarded...
Image

This issue has been introduced by CURATOR-729 (PR#520): https://github.com/apache/curator/pull/520/changes#diff-03152e1ad97a8fdbe50c309d864922eeb0bad131198922c9d865b08851c8d877R83

The listener created during PersistentWatcher#start should be removed in PersistentWatcher#close.

Best regards,
Vincent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions