New submission from orf <[email protected]>:

Running the attached code using 2.1 on Windows will cause a MemoryError. It 
creates a 
dictionary containing 10,000,000 unicode keys and attempts to access the 
dictionary 
using both a valid and an invalid key

Upon accessing the dictionary with an invalid key the program terminates with a 
MemoryError.

----------
files: pypy_bug.py
messages: 6179
nosy: orf, pypy-issue
priority: bug
release: 2.1
status: unread
title: Memory leak when accessing a dictionary with an non-existent key

________________________________________
PyPy bug tracker <[email protected]>
<https://bugs.pypy.org/issue1608>
________________________________________
import random, string

big_dict = {"".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"]
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to