peter-mount / opendata

Latest & first public version of my code that monitors the UK Rail Network in real time using Open Data feeds
Other
12 stars 2 forks source link

Cache blocking when full #15

Closed peter-mount closed 9 years ago

peter-mount commented 9 years ago

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.

peter-mount commented 9 years ago

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.