-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Lettuce metrics creates lots of long arrays, and gives out of memory error. #1210
Comments
So basically, there are two issues:
We're using We have 194 commands. Given that there are ~ 72000
Do you have a heap dump where you could inspect the various Given that the memory could be reclaimed after a couple of GC cycles, I'm not sure how to classify this issue. It could be that a metrics run released the latency objects and the fourth run actually was able to evacuate the objects from memory. Can you check whether any of the mentioned points above applies to your code? |
Hi @mp911de, thank you for the quick response. Yes, I did inspect the
I checked the first two points too. We don't provide |
…1210 We now use the String representation of a command for equality and hashCode computation.
…1210 We now use the String representation of a command for equality and hashCode computation.
…1210 We now use the String representation of a command for equality and hashCode computation.
We updated A snapshot build is available that contains the fix. Care to give |
Current Behavior
We are using Lettuce 5.0.4.RELEASE in our production environment for getting some data from Redis. And while scaling out we faced a very strange issue, that our app went out of memory under moderate traffic. I took the heap dump of the app and did the analysis. I figured out that the lettuce is allocating lots of AtomicLongArrays and those objects were taking almost 80% of the memory. When I tried to run GC forcefully using YourKit profiler, I was able to see GC Pause in the graphs but couldn't see memory getting freed. This happened 3 times and finally, when I forced GC for the 4th time the JVM released most of its memory.
After going through the GC roots of those Long arrays, I figured out that it has something to do with "Command Latency Metrics" in Lettuce. Those arrays belonged to the ConcurrentHashMap that was getting allocated by DefaultCommandLatencyCollector class.
I'm not sure what's happening, is this an expected behavior?
I'm attaching screenshots from YourKit.
Environment
The text was updated successfully, but these errors were encountered: