[ZODB-Dev] using ZODB w/IIS and memory leak

John.N.1@bwc.state.oh.us John.N.1@bwc.state.oh.us
Wed, 30 May 2001 08:20:49 -0400


Hello there,

I've been playing with ZODB to use as a simple pythonesque database. It
makes life simpler than even pickeling and doesn't have the complexities of
a major database.

I've also had problems . . .

Perhaps someone has an idea.

I have attempted to use ZODB w/IIS. An ASP page will load up information
from a ZODB database.

However, every time the page is loaded, memory is not reclaimed until all
the memory on the box is used. (it's loading about a 10 megabyte database).
Read-only or not, the memory is still used and not reclaimed.

Here's some example test code from an ASP page.

   try:
	if read_only: 
	    storage =
FileStorage.FileStorage(sys_dir+'/data/tmp/test-filestorage.fs',read_only=1)
	    db = DB( storage )
	    conn = db.open()  #use finally to close it
	    root = conn.root()
	    a=str(root['big']['ex'][1])+'re-open
connection'+str(round(time.time()-begin))
	    return a
	else:
	    storage =
FileStorage.FileStorage(sys_dir+'/data/tmp/test-filestorage.fs')
	    db = DB( storage )
	    conn = db.open()  #use finally to close it
	    try:
		root = conn.root()
		a=str(root['big']['ex'][2]) #then do something w/a
	    finally:
		db.close() #if db.open succeeds, the finally ensures
db.close called


Even if I explicity go through and del the variables so the vars() builtin
shows all the ZODB stuff as gone, the memory is still not reclaimed.

Any clues?

Thanks,

john