[pypy-issue] [issue1608] Memory leak when accessing a dictionary with an non-existent key

orf tracker at bugs.pypy.org
Sat Sep 21 02:51:34 CEST 2013


orf <tom at tomforb.es> added the comment:

Weird, I tried the attached code on another (older) Windows machine and it 
executed fine. I changed all the keys to be unicode and it failed with a string 
lookup (attached). Could you try running this code instead?

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1608>
________________________________________
-------------- next part --------------
import random, string

big_dict = {u"".join([random.choice(string.printable)
                     for i in xrange(40)]): random.randint(0,10000) for _ in xrange(10000000)}
valid_key = big_dict.keys()[0]
print "Valid key: %s" % big_dict[valid_key]
print "Invalid key: %s" % big_dict["test"]


More information about the pypy-issue mailing list