[issue28147] Unbounded memory growth resizing split-table dicts

INADA Naoki report at bugs.python.org
Wed Sep 14 16:16:59 EDT 2016


INADA Naoki added the comment:

This issue is caused by dictresize() and _PyObjectDict_SetItem()

1. a.__dict__.pop('a') convert the dict to combined table which has double keysize.
2. a.a = 1  converts the dict to split table again if there are no instances sharing key with class.

As I wrote before, pop, popitem, and del should not increase key size.

And _PyObjectDict_SetItem shouldn't convert the dict to split-table when the dict doesn't share keys
with the class before calling PyDict_SetItem.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28147>
_______________________________________


More information about the Python-bugs-list mailing list