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

WorkPool possible memory leak in Set<K> unlimited #69

Closed
xathien opened this issue Jun 24, 2015 · 4 comments
Closed

WorkPool possible memory leak in Set<K> unlimited #69

xathien opened this issue Jun 24, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@xathien
Copy link

xathien commented Jun 24, 2015

Short story: unregisterKey(K key) and unregisterAllKeys() does not unregister the key from Set<K> unlimited, which seems to result in leaks over time.

Longer story:

In our (Spring) application, we dynamically spin up and spin down queues and SimpleMessageListenerContainers as needed. I can describe the workflow in more detail if anyone really cares. After a day or two of decent load, our memory usage tends to grow very large. Analyzing a heap dump showed that the majority of memory was being used by a few hundred thousand ShutdownSignalExceptions and ChannelNs and various other related objects that still had references, all of which led back to this one Set in the WorkPool class.

It seems like a simple solution would be to add two lines which also call unlimited.remove, and I can create a Pull Request if desired, but I'm hoping that someone more familiar with the code can determine if this would cause any problems.

Thanks for all you folks do on this project. It's been fun implementing it into my system.

Link to feasible patch: https://gist.github.com/xathien/ec9ca35224868a524873

@michaelklishin michaelklishin self-assigned this Jun 24, 2015
@michaelklishin
Copy link
Member

Thank you, your analysis seems correct and patch plausible. Please submit a PR against the stable branch.

@michaelklishin michaelklishin added this to the 3.5.4 milestone Jun 24, 2015
@xathien
Copy link
Author

xathien commented Jun 24, 2015

Thanks for the very fast reply, Michael! I'm trying to set up the pull request, but it's not letting me push my branch -- I think I need at least some write privilege on the repo unless I'm doing something wrong (which I probably am; I'm more used to Gitlab than Github).

@michaelklishin
Copy link
Member

@xathien you need to push to your own fork: you will obviously have write permissions there.

This was referenced Jun 24, 2015
@michaelklishin
Copy link
Member

Fixed by @xathien in #71, will be in 3.5.4.

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

No branches or pull requests

2 participants