You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm thinking about memory leaks in this case if LRU is used on a server and cache key is something time based (e.g "today"). In this scenario old keys (when today has moved to the next day) will never be accessed (neither set or get), so never pruned. How would you solve it?
I see one simple/stupid solution to do like setInterval that does cache.clear() once in a while. But that would clear all items, not only stale.
The text was updated successfully, but these errors were encountered:
I'm thinking about memory leaks in this case if LRU is used on a server and cache key is something time based (e.g "today"). In this scenario old keys (when today has moved to the next day) will never be accessed (neither set or get), so never pruned. How would you solve it?
I see one simple/stupid solution to do like setInterval that does cache.clear() once in a while. But that would clear all items, not only stale.
Old items get pruned when a new item is added and the capacity is full.
I'm thinking about memory leaks in this case if LRU is used on a server and cache key is something time based (e.g "today"). In this scenario old keys (when today has moved to the next day) will never be accessed (neither
set
orget
), so never pruned. How would you solve it?I see one simple/stupid solution to do like
setInterval
that doescache.clear()
once in a while. But that would clear all items, not only stale.The text was updated successfully, but these errors were encountered: