lettuce
lettuce copied to clipboard
RedisClusterNodeSnapShot can't be released in timeout exception
Bug Report
We used the latest package of Lettuce to test Redis timeout scenarios. However, after we did a Java dump, we found that there were a large number of RedisClusterNodeSnapshot objects that were not properly released, even though the Redis requests had already been completed.
Current Behavior
The dump file contains 2915 arrays of RedisClusterNode, with each array containing either 16383 RedisClusterNode or RedisClusterNodeSnapshot.
The testing time is 48 hours and the size of the class is 200M. While examining the code, I noticed that RedisClusterNodeSnapshot is saved in a chain consisting of Views-Partitions-nodeWithStatus-RedisClusterNodeSnapshot. However, Views is a local variable and should not cause this phenomenon. It is possible that RedisClusterNodeSnapshot object is being persisted, which could be causing the high memory usage. Other potential causes could include static or global variables referencing the RedisClusterNodeSnapshot object, or other threads accessing the object preventing it from being garbage collected. To address this issue, Java Profiler or similar tools can be used to analyze memory leaks.
Environment
5.2.3.RELEASE