[Zope-dev] Re: collector entry - Memory Leak with ZSQL Methods (andy)

Chris McDonough chrism@digicool.com
Thu, 12 Apr 2001 10:52:26 -0400


Andy,

Brian pointed out today that you aren't just leaking SQL-related objects,
you're leaking requests... because requests hold a reference to every
traversed object (via PARENTS), if you're leaking reuqests, its a very bad
thing.  It would also explain why you see so many leaked SQL-related objects
if the site is heavily SQL-driven.

It may be that your code is keeping references to requests (maybe keeping a
global with tracebacks around?), or there is some other circular reference
problem.  As we haven't had any other corroborative reports of either the DA
leaking or the SQLMethods stuff leaking on their own, I'm sort of at a loss
to provide a solution.

Is there any way to make this bug reproducible on a clean Zope install?  Can
we boil it down to the simplest case?

- C

> A new bug entry was added with the following information:
>
> Title:  Memory Leak with ZSQL Methods
>
> At: http://classic.zope.org:8080/Collector/Collector/2154/sview
>
> Submitter:  andym
>
> Email:  andym@activestate.com
>
> Description:  When running a large number of SQL queries using ZSQLMethods
I get a memory large leak. Following is the information from debug_info
after 12 hours of running the server:
>
> Shared.DC.ZRDB.RDB.SQLAlias  62627  62642  +15
> Record.Record  10527  10531  +4
> Acquisition.ImplicitAcquirerWrapper  32441  32443  +2
> ExtensionClass  5522  5524  +2
> ZPublisher.HTTPRequest.HTTPRequest  3749  3750  +1
> ZServer.HTTPResponse.ZServerHTTPResponse  3742  3743  +1
> ZPublisher.BaseRequest.RequestContainer  3739  3740  +1
> Acquisition.Acquirer  2695  2696  +1
> Shared.DC.ZRDB.RDB.NoBrains  2630  2631  +1
>
> I can reproduce this easily. As a wild guess something is not being
correctly destroyed, no matter how many sweeps clears I do.
>
> A current workaround is to restart zope every 6 hours or so. This is
obviously sub optimal.