Random

As you can guess from its name, this eviction policy randomly selects entries to remove. It looks inefficient because there's a higher probability of removing most used entries and thereby decreasing the cache efficiency. However, there are a few cases where it can be a good choice. The main advantage of this strategy is that it doesn't rely on any eviction order maintenance and is, thus, fast to execute.

Before using it, make sure that it is really less efficient than the others: almost 20% less efficient than LRU, experimentally.

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.