freeMemoryIfNeeded(): improve code and lazyfree handling.
1. Refactor memory overhead computation into a function. 2. Every 10 keys evicted, check if memory usage already reached the target value directly, since we otherwise don't count all the memory reclaimed by the background thread right now.
Please register or sign in to comment