Actually, that leak risk is not there because of `purgeInternal`. There is a risk though that if the max is reached, an older entry is removed both the index and the cache store. The entry is gone, which for some cases it might be fine but not for others. So maxKeysInMemory is really maxEntries, which is how big the cache store can be, and entries are removed in LRU way. The more I look at this setting, the least useful I find it. IOW, the boundaries of the cache are defined by the expiration settings, or eviction settings left at the cache level. Not sure there's a need for an extra setting at the cache store level, which is not fully synched (2 max entries settings (cache and cache store), and 2 eviction algorithms (cache and cache store)).