When metrics get rebalanced from a losing server to a gaining server, the metric cache on the losing server takes up space (until expiration) even though it will never be updated or read. If this happens enough, the wasted memory is enough to consume the available heap in the JVM.
Create a configurable period where if a metric has not been updated in this time, it will be dropped from the cache, freeing up the memory.
When metrics get rebalanced from a losing server to a gaining server, the metric cache on the losing server takes up space (until expiration) even though it will never be updated or read. If this happens enough, the wasted memory is enough to consume the available heap in the JVM.
Create a configurable period where if a metric has not been updated in this time, it will be dropped from the cache, freeing up the memory.