memory-leak in pysqlite 2.3.0 ?

2006-06-19 Thread Michael Husmann
After upgrading from pysqlite 2.0.5 to pysqlite 2.3.0 writing into a
sqlite database increases memory consumption heavily. A similar program
with Ruby and sqlite-ruby 1.1.0 does not affect memory consumption at
all.

Here a short example:
---
#!/usr/bin/env python

import os
from pysqlite2 import dbapi2
print dbapi2.version

db = dbapi2.connect(bla.db)
c = db.cursor()

c.execute(create table b (c integer))

for i in xrange(1000):
c.execute(insert into b values (%d) % i)
  
--

System in use:
Python 2.4.1, Sqlite3 3.3.6, Pysqlite 2.3.0

Regards,
Michael

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: memory-leak in pysqlite 2.3.0 ?

2006-06-19 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Michael Husmann
wrote:

 After upgrading from pysqlite 2.0.5 to pysqlite 2.3.0 writing into a
 sqlite database increases memory consumption heavily. […]
 
 Here a short example:
 ---
 #!/usr/bin/env python
 
 import os
 from pysqlite2 import dbapi2
 print dbapi2.version
 
 db = dbapi2.connect(bla.db)
 c = db.cursor()
 
 c.execute(create table b (c integer))
 
 for i in xrange(1000):
 c.execute(insert into b values (%d) % i)

Just a guess: Commit the changes from time to time.

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: [pysqlite] memory-leak in pysqlite 2.3.0 ?

2006-06-19 Thread Gerhard Häring
Michael Husmann wrote:
 Michael Husmann wrote:
 After upgrading from pysqlite 2.0.5 to pysqlite 2.3.0 writing into a
 sqlite database increases memory consumption heavily. A similar program
 with Ruby and sqlite-ruby 1.1.0 does not affect memory consumption at
 all.
 [...]
 Python 2.4.1, Sqlite3 3.3.6, Pysqlite 2.3.0
 You never COMMIT your changes here, that's probably what's causing
 memory consumption on the SQLite side of things.
 [...]
 
 I also tried that commit(). Memory consumption still grows permanently.

Thanks for the report. Upon debugging this a little, there's indeed a 
bug which crept in in pysqlite 2.2.1 because of incorrect usage of the 
weak references (*). This leads to the list of weak references per 
connection to always grow and never shrink. I'll try to provide a fix 
real soon.

-- Gerhard

(*) A missing PyWeakref_GetObject(), but I'll have to take a more 
careful look.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [pysqlite] memory-leak in pysqlite 2.3.0 ?

2006-06-19 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gerhard Häring wrote:
 Michael Husmann wrote:
 Michael Husmann wrote:
 After upgrading from pysqlite 2.0.5 to pysqlite 2.3.0 writing into a
 sqlite database increases memory consumption heavily. A similar program
 with Ruby and sqlite-ruby 1.1.0 does not affect memory consumption at
 all.
 [...]
 Python 2.4.1, Sqlite3 3.3.6, Pysqlite 2.3.0
 You never COMMIT your changes here, that's probably what's causing
 memory consumption on the SQLite side of things.
 [...]
 I also tried that commit(). Memory consumption still grows permanently.
 
 Thanks for the report. Upon debugging this a little, there's indeed a 
 bug which crept in in pysqlite 2.2.1 because of incorrect usage of the 
 weak references (*). This leads to the list of weak references per 
 connection to always grow and never shrink. I'll try to provide a fix 
 real soon.
 
 -- Gerhard
 
 (*) A missing PyWeakref_GetObject(), but I'll have to take a more 
 careful look.

Fixed in Subversion. A pysqlite 2.3.1 release will follow during the next
days, which is the same code that will be in Python 2.5 beta1 btw.

- -- Gerhard
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFElxUfdIO4ozGCH14RAlk4AJ9JMMkGTdwJ5moM1/7FDFBP/XFZdACghOuj
2FNxgi7F7R+V6ARtzXgyNDY=
=29Gx
-END PGP SIGNATURE-
-- 
http://mail.python.org/mailman/listinfo/python-list