2

Eviction policies seem to be removed in EhCache3. There is an EvictionAdvisor interface that can be implemented, but what would be the default behaviour?

I am using EhCache3 with SpringBoot.

Rando
  • 25
  • 7

2 Answers2

0

The default is NO_ADVICE

From the javadoc :

Returns an {@link EvictionAdvisor} where no mappings are advised against eviction.

Anthony Dahanne
  • 4,823
  • 2
  • 40
  • 39
0

The exact eviction algorithm depends on the tier configuration. As such Ehcache does not detail it explicitly to enable tweaking it in the future.

Eviction advisors are an opt-in way of saying that some elements should really remain in the cache over others. It effectively means they are not considered by the eviction algorithm unless no eviction candidates can be found. Note that it is an advanced feature that can have quite severe performance effect if you end up advising against eviction a large portion of the cache.

And as said in another answer, there is no default - that is by default all entries are treated equal and subject to the internal eviction algorithm

Louis Jacomet
  • 13,661
  • 2
  • 34
  • 43
  • What about a single tier (off-heap store) only? – Rando Jun 29 '17 at 17:42
  • Not sure what the question is exactly ... but is all in the code. Offheap uses a clock evictor - see https://en.wikipedia.org/wiki/Page_replacement_algorithm#Clock - but again that is internal implementation detail that could change – Louis Jacomet Jul 03 '17 at 19:42