Hi!
On Thu, Oct 17, 2013 at 10:01:53PM +0100, "Maciej (Matchek) Blizi??ski" <ma...@op...> wrote:
> import sqlobject
>
> class Foo(sqlobject.SQLObject):
> bar = sqlobject.UnicodeCol(length=250, unique=True)
>
> db_uri = 'sqlite:/:memory:?cache=false'
> while True:
> sqlobject.sqlhub.processConnection = sqlobject.connectionForURI(db_uri)
> Foo.createTable()
> sqlobject.sqlhub.processConnection.close()
> sqlobject.sqlhub.processConnection = None
> sqlobject.dbconnection.TheURIOpener.cachedURIs = {}
>
> The process' memory kept growing. It started at around 30MB and was
> steadily raising up to 300MB at which point I stopped the process. I
> didn't do any more digging yet.
The program eats my memory very quickly and fails with MemoryError in
a few seconds.
On Sat, Oct 19, 2013 at 11:44:03AM +0100, "Maciej (Matchek) Blizi??ski" <ma...@op...> wrote:
> On Fri, Oct 18, 2013 at 01:14:46AM +0400, Oleg Broytman wrote:
> > It would be interesting to test if the problem lies in SQLite,
> > PySQLite or SQLObject.
>
> Looks like it's not SQLite, the following runs with stable memory use at
> about 7MB, I ran it for about an hour:
>
> import sqlite3
> while True:
> conn = sqlite3.connect(":memory:")
> c = conn.cursor()
> c.execute('CREATE TABLE foo (bar TEXT);')
> conn.commit()
> conn.close()
This one works for me, eats 9M at the start but doesn't grow.
And this one also works perfectly:
import sqlobject
class Foo(sqlobject.SQLObject):
bar = sqlobject.UnicodeCol(length=250, unique=True)
db_uri = "sqlite:/:memory:"
while True:
Foo.setConnection(db_uri)
Foo.createTable()
Foo._connection.close()
It takes 15M at startup but doesn't grow.
Very puzzling!
Oleg.
--
Oleg Broytman http://phdru.name/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|