Skip to content

Default LRU cache does not always guarantee to limit the size under maximum #3507

Description

@xiaoyao1991

It looks to me that the default LRU MapCache does not always guarantee to limit the cache size under the preset cache size maximum limit.

Currently, the cache eviction happens when a new cache entry is inserted and the insertion cause the cache size to exceed its maximum. In this case, the cache would remove only 1 entry(the least recently used) from the existing map. However, it doesn't check if the cache size is below maximum after removal. This can cause cache size to grow slowly to an unexpected number under some designated workload.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions