Class Lazy.Checker.Default

java.lang.Object
one.microstream.reference.Lazy.Checker.Default
All Implemented Interfaces:
Lazy.Checker, Lazy.ClearingEvaluator
Enclosing interface:
Lazy.Checker

public static final class Lazy.Checker.Default
extends Object
implements Lazy.Checker, Lazy.ClearingEvaluator
This implementation uses two dimensions to evaluate if a lazy reference will be cleared:
- time: a ref's "age" in terms of Lazy.lastTouched() compared to System.currentTimeMillis()
- memory: the amount of used memory compared to the permitted quota of total available memory.

Either dimension can be deactivated by setting its configuration value to 0.
If both are non-zero, a arithmetically combined check will make clearing of a certain reference more like the older it gets as free memory shrinks.
So, as free memory gets lower, older/passive references are cleared sooner, newer/active ones later.