durusmail: durus-users: Moving cache from object count to size
Moving cache from object count to size
2010-09-24
2011-03-15
Moving cache from object count to size
Neil Schemenauer
2011-01-16
Jesus Cea  wrote:
> I have objects 50 bytes long, and 60Kbytes long :-(. I would
> suggest to change the cache code to control cache size, instead of
> object count.

I played with this idea a little.  It seems like the bookkeeping
will get pretty complicated.  Iterating over all objects in the
cache to find the current size does not seem feasible, for
performance reasons.  Therefore, the cache would have to keep track
of the total size as objects are added and removed.  The fact that
objects are weakly referenced by the cache futher complicates
things.

Maybe I'm missing a simple implementation but it doesn't appear to
be worth the effort, IMHO.

Regards,

  Neil

reply