I thought that once a cursor went out of scope, it would be collected
(or when the gc kicks in. I also tried to run the gc manually, but they
still didn't get collected). I could of course change my get_connection
function to return an old cursor instead of creating a new one each
time.

With the test you provided there are no leaks.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ed Leafe
Sent: 3. oktober 2006 17:29
To: Dabo Users list
Subject: Re: [dabo-users] Memory leak in dCursor?

On Oct 3, 2006, at 11:02 AM, Simen Haugen wrote:

> I did a test where I just set up my application and ran
> connection.getDaboCursor().execute("select * from tbl_blobvalues")
> several times. Each time the memory is added up.

        So you're creating several cursors, right? If you don't hold  
references to the cursors, then it's up to Python to garbage-collect  
that memory.

        A better test would be to do something like:

crs = connection.getDaboCursor()

while True:
        crs.execute("select * from tbl_blobvalues")
        report_your_memory_status()

This way you are working with a single cursor, and it should be  
replacing the data in the cursor each time, instead of creating  
several cursors, each with its own copy of the data.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to