Keyvaluestore cache

Mainly add header cache to KeyValueStore, in order to make header passed with shared_ptr, there exists many methods arguments needed to change.
So we (up to EVICT_COUNT times) iterate forward COMPARE_COUNT items and evict the lowest frequency found among those items?  Should we instead iterate through EVICT_COUNT*COMPARE_COUNT items and evict the minimum COMPARE_COUNT found if COMPARE_COUNT is not large?