[Zope-DB] DCO2 and memleaks...

Matthew T. Kromer matt@zope.com
Thu, 02 May 2002 10:28:48 -0400

Dario Lopez-K=E4sten wrote:

>We have DCO2 on Linux and we are experiencing two problems:
>For certain large queries, zope keeps a connection to the oracle server
>after the query has finished, which over time makes the database server =
>up all it's resources, requiring it to be restarted.
>related to this, this query also seems to make zope/python leak memory.
>usage goes from 23 MB ram to about 200-300 MBs (normal operating mem
>footprint is 25-35 MB).
>Restarting the zope app, makes both the DB server happy, as well as memo=
>usage go down to acceptable levels.
>Zope 2.4.4b1
>python 2.1.2 with patches
>DCO2 from cvs from late january
>loads and loads of DTML and PythonScripts
>loads and laods of zsql's (all data is in Oracle server, queries need to
>return 1000's of rows sometimes)
>Any hint on what might be causeing this? Workarounds? Known bugs?
>I assume that this is not the intended behaviour of DCO2/Zope, even is t=
>queries are inane (we know some of the are, and we're working on fixing
>Anybody know if this is fixed in the latest DCO2 release?

Hi Dario

A lot of times this happens because the DB Connection object is either=20
closed before all associated cursors are closed, or because someone=20
never actually closes cursors or connections.   This is very likely to=20
be a flaw in ZOracleDA as connections become inactive.

In other words, the adapter layer is likely OK, and just doing what it=20
was told to do -- it was never told to release the resources.  I'm a bit=20
fuzzy on how smart ZOracleDA is on shutting down cursors/connections=20
gracefully -- although my guess is it isnt very smart at all on the subje=

Matt Kromer
Zope Corporation  http://www.zope.com/=20