[Twisted-Python] deferreds, and .rpy resources

L. Daniel Burr ldanielburr at earthlink.net
Fri Jan 24 14:08:30 EST 2003

On Fri, 24 Jan 2003 00:39:36 -0800, Dave Peticolas wrote:
>On Thu, 2003-01-23 at 17:25, L. Daniel Burr wrote:
>>Of course, you could also use twisted.enterprise.adbapi,
>>but I've experienced a lot of memory leaks occurring when
>>going that route, so I just use deferToThread instead.
>I'm about to start using t.e.adbapi pretty heavily, so I'm
>interested in this report. Do you have more details?

To be clear, I definitely *haven't* been using adbapi heavily up
until this point.  The problem I experienced occurred around the
time of Twisted 1.0.1 final, and deadlines prevented my doing any
exhaustive testing.

The scenario was pretty basic:  Connect to an Oracle database,
perform a query, return the result.  Using adbapi from Twisted
1.0.1 and the cx_Oracle DBAPI module, the twistd process showed
steady growth in size.  Each time the code executed, the process
would grow by 10-50k, never releasing any memory.

The same scenario, using DCOracle2, showed similar leakage.
Having insufficient time to debug the thing, I went with the
process of elimination, and started using deferToThread instead
of adbapi, and the leak was gone.  That does not in any way prove
that adbapi is the root cause, only that it may be involved in
some way.

This was all on Win32, by the way, so I have no idea if it is an
issue on Linux or Solaris.  In any case, I'll get a chance to revisit the issue shortly, and I'll report my findings.

L. Daniel Burr

More information about the Twisted-Python mailing list