[Tim Peters] > 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. OK, that actually wasn't the first test to produce garbage, it was just the first time test.py *noticed* gc.garbage wasn't empty. The first test to produce garbage was BuddyCityState, and it produces garbage in isolation: C:\Code\Zope3>\code\python\PCbuild\python_d.exe test.py -vv . BuddyCityState Configuration file found. Running UNIT tests at level 1 Running UNIT tests from C:\Code\Zope3 BuddyCityState (buddydemo.buddy) ... ok The following test left garbage: BuddyCityState (buddydemo.buddy) 28 entries in gc.garbage: 0: <weakref at 03C86F20; to 'InterfaceClass' at 012B5930 (IWriteContainer)> 0x12B5930 is <InterfaceClass zope.app.container.interfaces.IWriteContainer> 1: <weakref at 03C8E080; to 'InterfaceClass' at 00B5EAB8 (Interface)> 0xB5EAB8 is <InterfaceClass zope.interface.Interface> 2: <weakref at 03C8E1A0; to 'Surrogate' at 03C8D4D0> 0x3C8D4D0 is <Surrogate(<InterfaceClass zope.app.container.interfaces.IWriteContainer>)> 3: <weakref at 03C8E278; to 'InterfaceClass' at 012B5578 (IObjectEvent)> 0x12B5578 is <InterfaceClass zope.app.event.interfaces.IObjectEvent> 4: <weakref at 03C8E398; to 'Surrogate' at 03C8D6C8> 0x3C8D6C8 is <Surrogate(<InterfaceClass zope.app.event.interfaces.IObjectEvent>)> 5: <weakref at 03C8E3E0; to 'InterfaceClass' at 01197230 (IHTTPRequest)> 0x1197230 is <InterfaceClass zope.publisher.interfaces.http.IHTTPRequest> 6: <weakref at 03C8E500; to 'InterfaceClass' at 0118ACE8 (IRequest)> 0x118ACE8 is <InterfaceClass zope.publisher.interfaces.IRequest> 7: <weakref at 03C8E620; to 'InterfaceClass' at 0118A818 (IPublisherRequest)> 0x118A818 is <InterfaceClass zope.publisher.interfaces.IPublisherRequest> 8: <weakref at 03C8E740; to 'InterfaceClass' at 0118A5E8 (IPublicationRequest)> 0x118A5E8 is <InterfaceClass zope.publisher.interfaces.IPublicationRequest> 9: <weakref at 03C8E860; to 'InterfaceClass' at 00DB9690 (IPresentationRequest)> 0xDB9690 is <InterfaceClass zope.component.interfaces.IPresentationRequest> 10: <weakref at 03C8E980; to 'Surrogate' at 03C8DAB8> 0x3C8DAB8 is <Surrogate(<InterfaceClass zope.component.interfaces.IPresentationRequest>)> 11: <weakref at 03C8E9C8; to 'InterfaceClass' at 00DA0188 (IParticipation)> 0xDA0188 is <InterfaceClass zope.security.interfaces.IParticipation> 12: <weakref at 03C8EAE8; to 'Surrogate' at 03C8DB28> 0x3C8DB28 is <Surrogate(<InterfaceClass zope.security.interfaces.IParticipation>)> 13: <weakref at 03C8EB30; to 'Surrogate' at 03C8DA10> 0x3C8DA10 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IPublicationRequest>)> 14: <weakref at 03C8EB78; to 'Surrogate' at 03C8DA10> 0x3C8DA10 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IPublicationRequest>)> 15: <weakref at 03C8EBC0; to 'Surrogate' at 03C8D968> 0x3C8D968 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IPublisherRequest>)> 16: <weakref at 03C8EC08; to 'InterfaceClass' at 0118AC08 (IApplicationRequest)> 0x118AC08 is <InterfaceClass zope.publisher.interfaces.IApplicationRequest> 17: <weakref at 03C8ED28; to 'InterfaceClass' at 01177F18 (IEnumerableMapping)> 0x1177F18 is <InterfaceClass zope.interface.common.mapping.IEnumerableMapping> 18: <weakref at 03C8EE48; to 'InterfaceClass' at 01177D58 (IReadMapping)> 0x1177D58 is <InterfaceClass zope.interface.common.mapping.IReadMapping> 19: <weakref at 03C8EF68; to 'InterfaceClass' at 01177C40 (IItemMapping)> 0x1177C40 is <InterfaceClass zope.interface.common.mapping.IItemMapping> 20: <weakref at 03C8F0C8; to 'Surrogate' at 03C8DD20> 0x3C8DD20 is <Surrogate(<InterfaceClass zope.interface.common.mapping.IItemMapping>)> 21: <weakref at 03C8F110; to 'Surrogate' at 03C8DC78> 0x3C8DC78 is <Surrogate(<InterfaceClass zope.interface.common.mapping.IReadMapping>)> 22: <weakref at 03C8F158; to 'Surrogate' at 03C8DBD0> 0x3C8DBD0 is <Surrogate(<InterfaceClass zope.interface.common.mapping.IEnumerableMapping>)> 23: <weakref at 03C8F1A0; to 'Surrogate' at 03C8D9D8> 0x3C8D9D8 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IApplicationRequest>)> 24: <weakref at 03C8F1E8; to 'Surrogate' at 03C8D8C0> 0x3C8D8C0 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IRequest>)> 25: <weakref at 03C8F230; to 'Surrogate' at 03C8D8C0> 0x3C8D8C0 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IRequest>)> 26: <weakref at 03C8F278; to 'Surrogate' at 03C8D8C0> 0x3C8D8C0 is <Surrogate(<InterfaceClass zope.publisher.interfaces.IRequest>)> 27: <weakref at 03C8F2C0; to 'Surrogate' at 03C8D818> 0x3C8D818 is <Surrogate(<InterfaceClass zope.publisher.interfaces.http.IHTTPRequest>)> [703156 refs] C:\Code\Zope3> It appears generally true that, like in that test, gc.garbage gets filled with (hundreds of thousands of) weakrefs specifically due to adaptation machinery. By inspection, there are a lot of weakrefs flying around there <wink>.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4