[Zope-dev] _p_deactivate() and _v_ variables?

Toby Dickenson tdickenson at geminidataloggers.com
Fri Sep 26 04:37:37 EDT 2003


On Friday 26 September 2003 09:32, Chris Withers wrote:
> Toby Dickenson wrote:
> > On Thursday 25 September 2003 11:51, Chris Withers wrote:
> >>Hmmm, does _p_deactivate() clear the contents of the object's _v_
> >>variables?
> >
> > Yes
>
> Then given your earlier comment that _v_ variables are supposed to last at
> least teh length of the request, John's idea of using _p_deactivate() to
> reduce memory usage for large ZCatalog results sets could be seen as
> playing with fire, right?

He had code that would only deactivate objects at the end of a loop if they 
were not active at the start of the loop. Its not entirely safe, but I think 
it mitigates the most serious risks here.

ZCatalog (and others) have used this same technique for a while.

-- 
Toby Dickenson




More information about the Zope-Dev mailing list