2013/10/17 Oleg Broytman <ph...@ph...>
>
> Hi!
>
> On Wed, Oct 16, 2013 at 10:58:24PM +0100, "Maciej (Matchek) Blizi??ski" <ma...@op...> wrote:
> > - there already is special handling for in-memory databases, so
> > maybe add a little more special handling for them; for example free
> > the memory on close().
>
> The patch to test is attached.
Thanks!
I applied the patch and ran the the following test:
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.
Maciej
|