[Zope] Refresh causes spinning Zope (bug with my Product?)

Dieter Maurer dieter at handshake.de
Fri Apr 2 18:09:19 EST 2004


John Ziniti wrote at 2004-4-1 15:22 -0500:
> ...
>As I've had more time to look into
>this problem, it is apparent that Zope is *not* spining forever.  It
>is just taking several minutes to recover from the first access
>to instances of the refreshed product.

A refresh causes the ZODB cache to be abandoned.

ZODB's standard code just abandons the cache (without any cleanup).
This results in a huge cyclic data structure the cyclic
garbage collector needs to recycle.

I have a patched "ZODB.Connection.Connection._resetCache"
which explicitely calls "orig_cache.clear()".
This breaks the cycles and allows the RC based (and not the cyclic)
garbage collector to clean up.
I am not sure whether this speeds things up. It definitely
moves work from the cyclic GC to the RC based GC which might
by more efficient.

Maybe, you try it and report back.
I have been unable to convince Jeremy that the "clear" is useful.
Maybe, your data points can make this issue clearer.

> ...
>So I feel like I am doing something in my Product that is causing the
>garbage collector a whole lot of trouble when the Product is refreshed.
>
>Are there any guidelines for "stupid things you should never do in a
>Product"?

Do you observe excessive memory consumption?
This could indicate that the objects created by your product
are too big (and therefore take excessive time to be recycled).

Do you have an especially large ZODB cache?
Recycling a huge ZODB cache is more expensive than recycling
a small one.

-- 
Dieter



More information about the Zope mailing list