If the Cache class is suddenly flooded and becomes full the eviction process that should release some space cannot as all of it's content is too fresh, so the process blocks.
We need to change the emergency eviction algorithm to either remove the oldest or least used entries rather than the current algorithm of removing entries older than a set limit.
I've changed the algorithm used when the cache is full. Now it removes the oldest 25% of entries rather than those within 2 minutes of the oldest entry.
If the Cache class is suddenly flooded and becomes full the eviction process that should release some space cannot as all of it's content is too fresh, so the process blocks.
We need to change the emergency eviction algorithm to either remove the oldest or least used entries rather than the current algorithm of removing entries older than a set limit.