I am using Lettuce 3.x that occasionally throws OutOfMemory errors while using LatencyUtils class. Here is the Heap dump trace.
Class Name | Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------
org.LatencyUtils.SimplePauseDetector @ 0x3c4e36fd0 | 80 | 3,828,661,568
|- <class> class org.LatencyUtils.SimplePauseDetector @ 0x3c4b13a28 | 24 | 24
|- highPriorityListeners java.util.ArrayList @ 0x3c4e37020 | 24 | 559,776
|- normalPriorityListeners java.util.ArrayList @ 0x3c4e37038 | 24 | 3,548,415,056
| |- <class> class java.util.ArrayList @ 0x3c0a2f790 System Class | 32 | 80
| |- elementData java.lang.Object[70803] @ 0x3d7913170 | 283,232 | 3,548,415,032
| | |- <class> class java.lang.Object[] @ 0x3c0843868 | 0 | 0
| | |- [17] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fca0e80| 32 | 113,160
| | |- [16] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fca1b10| 32 | 113,160
| | |- [15] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fca27a0| 32 | 113,160
| | |- [14] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fceba58| 32 | 113,160
| | |- [13] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fcec6e8| 32 | 113,160
| | |- [12] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fd37638| 32 | 113,160
| | |- [11] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fd382c8| 32 | 113,160
| | |- [10] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fd38f58| 32 | 113,160
| | |- [9] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fd814a8 | 32 | 113,160
| | |- [8] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fd82138 | 32 | 113,160
| | |- [7] org.LatencyUtils.LatencyStats$PauseTracker @ 0x42fdcc700 | 32 | 113,160
-----------------------------------------------------------------------------------------------------
Note that this happened only once and auto recovered after my service was restarted. I want to avoid the service outage in future due to this issue.