void (double fraction) { long current = System.currentTimeMillis(); long last = lastClearedTimeStamp.get(); if (current - last >= 500 && lastClearedTimeStamp.compareAndSet(last, current)) { // fraction is changed when each file is processed => // resolve caches used when searching in that file are likely to be not needed anymore dropResolveCaches(); } }