Class DClockPolicy
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.simulator.policy.irr.DClockPolicy
-
- All Implemented Interfaces:
Policy,Policy.KeyOnlyPolicy
public final class DClockPolicy extends Object implements Policy.KeyOnlyPolicy
Double Clock algorithm. This algorithm organizes blocks by their reuse distance and partitions the cache into an active and inactive space. A new arrival enters the inactive space and on a subsequent hit is promoted to the active space, which may cause the oldest active entry to be demoted to be inactive. An eviction discards the oldest inactive entry which becomes a shadow (non-resident) node and is stamped with its refault distance. If on a cache miss the shadow entry exists and has a refault distance that is less than the active space's size, then it is optimistically promoted on insert.The algorithm is explained by the authors in linux/mm/workingset.c. The target size of the active and inactive list is calculated in linux/mm/vmscan.c.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy
Policy.Characteristic, Policy.KeyOnlyPolicy, Policy.PolicySpec
-
-
Constructor Summary
Constructors Constructor Description DClockPolicy(com.github.benmanes.caffeine.cache.simulator.policy.irr.DClockPolicy.DClockSettings settings, double percentActive)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinished()Indicates that the recording has completed.static Set<Policy>policies(Config config)Returns all variations of this policy based on the configuration parameters.voidrecord(long key)PolicyStatsstats()Returns the cache efficiency statistics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.benmanes.caffeine.cache.simulator.policy.Policy.KeyOnlyPolicy
record
-
-
-
-
Method Detail
-
policies
public static Set<Policy> policies(Config config)
Returns all variations of this policy based on the configuration parameters.
-
record
public void record(long key)
- Specified by:
recordin interfacePolicy.KeyOnlyPolicy
-
stats
public PolicyStats stats()
Description copied from interface:PolicyReturns the cache efficiency statistics.
-
-