Actually, this is not a problem. Whenever a key is stored, it checks if the limit has been exceeded, in which case it removes it from the index and it frees up the space. Removing from the index happens in evict(), and freeing up the index in free(fe) call. Purge internal makes sure any expired entries are removed from the index and space is freed too. I'm adding a unit test that verifies this.