@ Override protected Entry findEvictionCandidate ( Entry _previous ) { coldRunCnt ++ ; Entry _hand = handCold ; int _scanCnt = 1 ; if ( _hand == null ) { _hand = refillFromHot ( _hand ) ; } if ( _hand . hitCnt > 0 ) { _hand = refillFromHot ( _hand ) ; do { _scanCnt ++ ; coldHits += _hand . hitCnt ; _hand . hitCnt = 0 ; Entry e = _hand ; _hand = Entry . removeFromCyclicList ( e ) ; coldSize -- ; e . setHot ( true ) ; hotSize ++ ; handHot = Entry . insertIntoTailCyclicList ( handHot , e ) ; } while ( _hand != null && _hand . hitCnt > 0 ) ; } if ( _hand == null ) { _hand = refillFromHot ( _hand ) ; } coldScanCnt += _scanCnt ; handCold = _hand . next ; return _hand ; }
Runs cold hand an in turn hot hand to find eviction candidate .