[Python-Dev] Re: patch-finalizer vs Zope3

Jim Fulton jim at zope.com
Thu Nov 4 18:24:53 CET 2004

Tim Peters wrote:
> FYI, and without taking time for non-trivial analysis.  I ran the non-ZEO
> Zope3 tests with a Python patched to treat weakrefs with callbacks as
> reachable (this was patch-finalizer.txt, attached to a msg I sent to
> python-dev last night).
> The first test to leave stuff in gc.garbage then:
>     The following test left garbage:
>     test_created (bugtracker.browser.tests.test_bug.BugBaseViewTest)
>     65
> where 65 is len(gc.garbage) after the test finished.  From there it climbed
> steadily.  By the time the functional tests ended, the Python process was
> about 575MB, and gc.garbage contained 324,056 weakrefs.
> I haven't investigated why it happens, but that it *does* happen in an app
> that believes it's well-behaved

It's all a question of your definition of good behavior. ;)

 > suggests that "practicality beats purity"
> would win in the end (i.e., no matter how elegant the approach, if it's too
> hard to live with, it won't fly).

Treating weakrefs with callbacks as reachable is a *big* change,
though in subtle ways.  I agree that this is too big for 2.4, but I *do*
think it should be considered for 2.5.


Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org

More information about the Python-Dev mailing list