Package one.microstream.reference
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
- memory: the amount of used memory compared to the permitted quota of total available memory.
- 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.
- 
Nested Class SummaryNested classes/interfaces inherited from interface one.microstream.reference.Lazy.CheckerLazy.Checker.Default, Lazy.Checker.Defaults
- 
Constructor SummaryConstructors Constructor Description Default()
- 
Method SummaryModifier and Type Method Description voidbeginCheckCycle()booleancheck(Lazy<?> lazyReference)voidendCheckCycle()static longgraceTimeMinimum()static doublememoryQuotaNoCheck()booleanneedsClearing(Lazy<?> lazyReference)
- 
Constructor Details- 
Defaultpublic Default()
 
- 
- 
Method Details- 
memoryQuotaNoCheckpublic static double memoryQuotaNoCheck()
- 
graceTimeMinimumpublic static long graceTimeMinimum()
- 
beginCheckCyclepublic final void beginCheckCycle()- Specified by:
- beginCheckCyclein interface- Lazy.Checker
 
- 
endCheckCyclepublic void endCheckCycle()- Specified by:
- endCheckCyclein interface- Lazy.Checker
 
- 
check- Specified by:
- checkin interface- Lazy.Checker
- Parameters:
- lazyReference- the lazy reference to check against
- Returns:
- if additional checks should be prevented
 
- 
needsClearing- Specified by:
- needsClearingin interface- Lazy.ClearingEvaluator
 
 
-