Cache eviction trigger

The previous algorithms define how to select the items to evict when the eviction is triggered. It means that if the eviction is not triggered, they are pointless. Eviction triggers can be of multiple types, but the main ones are the following:

  • Size: The size of the cache can be of several types, such as the actual number of objects of the cache or the memory size (in bits or bytes).
  • Expiration: With each element, you can associate an end of life. When the end of life is reached, then the element should be evicted (removed) from the cache. Note that this parameter is not strict, and the element can stay in memory and be removed during access if the cache doesn't use a background thread to evict the element fast enough. ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.