-
Notifications
You must be signed in to change notification settings - Fork 172
Slow memory leak #1192
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
Comments
Thanks for the report. Could you share what features of NATS Core you are using, pub/sub and/or request/reply? Could you perhaps also create a small code snippet that shows your general interactions with the library? (For example making a connection and what pub/sub/request/reply actions are being performed) And just checking; I assume the Y-axis is memory used in GBs? |
Thanks for your quick reply! I'm using pub/sub (not using request/reply). The Y-axis is the percentage of allocated memory used. This is how I'm making a connection:
And I'm publishing like this:
There's a subscriber in another deployment using the Go client and there are no memory issues there. |
It doesn't seem to reproduce when just calling However, if a reconnect to the server was performed the thread count would keep rising and not go down. This issue is fixed starting from version 2.17.7. I'm assuming it was the Timer task that was used for PINGs to the server not being cleaned up after a reconnect, which was fixed in this PR: #1128. Could you upgrade to latest 2.20.0 version and check if the issue is resolved? |
Interesting, I'll try that. Thanks! |
@tinder-marissanovak 2.20.1 has been released, which might have additional fixes for reconnect. Thank you for your feedback and patience. |
Thank you! The memory usage after a few days seems more stable in |
Observed behavior
My pods that are running the NATS Java client are consuming more and more memory. I'm not using JetStream. There are slow consumers 1-2 times a week but they don't seem correlated with the memory usage increases since they don't happen at the same time. There are no errors or warnings logged by the Java client or on the NATS server.
Expected behavior
Memory usage stays constant
Server and client version
Client version 2.17.6
Server version 1.x
Host environment
No response
Steps to reproduce
I'm using default Options to create the Connection, other than
maxReconnects
is 300 andmaxMessagesInOutgoingQueue
is default * 2The text was updated successfully, but these errors were encountered: