gdbm memory leak

Eric Bouck (ebouck@myhost.subdomain.domain)
11 Mar 1995 15:49:32 GMT

(apologies if this is a duplicate post)

The gdbm module seems to have a memory leak.
The following code demonstrates it:

import gdbm

LargeNumber = 5000
d = gdbm.open ('testdbm', 'w', 0666)
i = 0
# this does not leak memory
while i < LargeNumber:
d[str(i)] = 'object %d' % i
i = i + 1
i = 0
# this does leak memory
while i < LargeNumber:
print d[str(i)]
i = i + 1

Does anyone have a fix?

Eric