Skip to content

Change the L2 maxSize behavior to evict idle entries #515

@nekhtan

Description

@nekhtan

Hello,

It seems that the datanucleus.cache.level2.maxsize feature is only preventing the cache from storing more objects once it reaches the defined limit. Would that be possible to change this behavior so that it starts evicting idle entries when the threshold is near (or even reached if it's easier to do) ?

Also, looking at the AbstractReferencedLevel2Cache, since the putAll method does not implement the maxSize feature and the put method checks for equality, isn't it possible that even the implemented feature (on the put) is broken because the threshold is exceeded following a call to putAll ?

Example:

  • maxSize=10
  • put(1) -> ok - size = 1
  • put(1) -> ok - size = 2
  • putAll(10) -> ok - size = 12
  • put(1) -> ok -> should have been rejected, right ?

Thanks in advance for your insight !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions