Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBeans has never been destroyed #7329

Closed
andrkomarov opened this issue Jan 14, 2016 · 1 comment · Fixed by #7337
Closed

MBeans has never been destroyed #7329

andrkomarov opened this issue Jan 14, 2016 · 1 comment · Fixed by #7337
Assignees
Milestone

Comments

@andrkomarov
Copy link

When hazelcast.jmx option is enabled MBeans are created for every Hazelcast object but are never removed.
When destroying Hazelcast object with destroy() method, DistributedObjectEvent::getDistributedObject() throws DistributedObjectDestroyedException and stops the process of unregistering MBeans. MBeans are left forever causin memory leaks and can be seen in visualvm.
mbeans_count
Also there are eventually strange numbers in totalAddedItemCount (should be 100)

The code I've run:

public static void main(String [] args) throws InterruptedException {

    Config config = new Config();
    HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);

    for (int i = 0; i < 100000; i++) {
        IQueue<String> q = instance.getQueue(String.format("queue_%08d", i));
        for(int j = 0; j < 100; j++) {
            q.offer("test_" + j);
        }
        q.destroy();
    }
}

The heap without hazelcast.jmx=true:
heap_nojmx

The heap with hazelcast.jmx=true:
heap_jmx_

@jerrinot
Copy link
Contributor

hello @andrkomarov,
thanks a lot for a very nice report, it's much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants