Closed mattharr013 closed 1 year ago
Currently when group.Set is called, if the key already exists in a cache instance, then nbytes is not updated correctly since OnEvicted is not called.
group.Set
cache
nbytes
OnEvicted
This means the cache slow leaks memory eventually being unable to cache any items.
To fix this, this PR updates the lru cache to call OnEvicted when replacing the value of an existing key.
@thrawn01 is there any chance that this can be released?
Currently when
group.Set
is called, if the key already exists in acache
instance, thennbytes
is not updated correctly sinceOnEvicted
is not called.This means the cache slow leaks memory eventually being unable to cache any items.
To fix this, this PR updates the lru cache to call
OnEvicted
when replacing the value of an existing key.