Jeremy Hylton wrote at 2003-12-8 15:28 -0500:
>On Mon, 2003-12-08 at 13:17, Dieter Maurer wrote:
>> Jeremy Hylton wrote at 2003-12-7 23:01 -0500:
>> >On Sun, 2003-12-07 at 08:15, Dieter Maurer wrote:
>> >>   ATT: replacing the cache without clearing it can lead to huge
>> >>   memory leaks (everything in the old cache is leaked!).
>> >
>> >Without commenting on the rest of the bug report, I should mention that
>> >caches and persistent objects all participate in cyclic GC.  They will
>> >not leak the way pre-2.8 caches did.
>> 
>> Has the "do not free when a cycle contains an object with destructor"
>> restriction been removed from the cyclic GC?
>> 
>> It is not unlikely that the cache references an object with a "__del__".
>> This may keep the cache and all its content.
>
>I don't think it makes a lot of sense to put an __del__ method on a
>Persistent object.

I just read in "cPersistence.c:ghostify":

    /* We remove the reference to the just ghosted object that the ring
     * holds.  Note that the dictionary of oids->objects has an uncounted
     * reference, so if the ring's reference was the only one, this frees
     * the ghost object.  Note further that the object's dealloc knows to
     * inform the dictionary that it is going away.
     */

This means: *all* persistent objects have a special "dealloc"
function. Hope, this "dealloc" function plays well with the
cyclic garbage collector.

-- 
Dieter

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to