[ZODB-Dev] [Proposal] Size controlled ZODB cache

Dieter Maurer dieter at handshake.de
Fri Jun 3 16:47:08 EDT 2005

Chris Withers wrote at 2005-6-3 08:24 +0100:
> ...
>I don't suppose there's any way that, as part of this work, the size of 
>the cache could also be limited DURING a transaction?

I am a big user of "_v_" variables
and I am interested that they disappear only at transaction

Therefore, I will not implement cache cleanup in the middle of
a transaction.

But Shane proposed to make the cache type pluggable.

So, you could implement a cache that performs garbage collection
whenever it reaches some limits -- even in the middle of a transaction.
Note, that it may not be trivial to avoid trashing (where new
objects flush others that are soon needed again in the transaction).

> ...
>It would also mean a lot of the abuses of get_transaction().commit() and 
>get_transaction().abort() (and the ._p_deactivate() stuff ZopeFind) 
>wouldn't be needed anymore...

I agree that it would be nice to optionally perform garbage collection
also in the middle of a transaction. However, we would then
need a way to protect "_v_" attributes from eager collection.

I have implemented such a protection ("_p_sticky") (sits somewhere
in the collector) but it did not yet find its way into the ZODB core...


More information about the ZODB-Dev mailing list