[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread STINNER Victor
STINNER Victor added the comment: > According to > https://www.python.org/dev/peps/pep-0412/#split-table-dictionaries > `obj.__dict__` is always a split-table dict. Hum, this PEP is now probably outdated since Python 3.6 beta 1 :-) -- ___ Python

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK
Min RK added the comment: > dictresize() is called for converting split table to combined table. > How is it triggered many times? every `self.__dict__.pop` triggers a resize. According to https://www.python.org/dev/peps/pep-0412/#split-table-dictionaries `obj.__dict__` is always a

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: Ah, is the leak happen in 3.6b1? dict.pop() in 3.6b1 doesn't combine split table. It was a bug and fixed in master branch already. Regardless the leak, I agree that grow dict when popping is bad idea. I'll improve your patch. --

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread STINNER Victor
STINNER Victor added the comment: The CPython test suite uses a counter on memory allocations. Please add an unit test which triggers the memory leak, but you don't need many iterations. One iteartion should be enough to be catched by the unit test. Try: ./python -m test -R 3:3 test_dict.

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread INADA Naoki
INADA Naoki added the comment: I don't understand the leak yet. > Each time dict_resize is called, it gets a new, larger size `> minused`. If > this is triggered many times, it will keep growing in size by a factor of two > each time, as the previous size is passed as minused for the next

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK
Min RK added the comment: I can add the cpython_only decorator, but I'm not sure it is the right thing to do. I would expect the code in the test to pass on any Python implementation, which would suggest that it should not be cpython_only, right? If you still think so, I'll add it.

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Berker Peksag
Berker Peksag added the comment: Can you wrap the test with @support.cpython_only decorator? The patch fixes the memory leak demonstrated in test-dict-pop.py. -- nosy: +berker.peksag, haypo, methane stage: -> patch review ___ Python tracker

[issue28147] Memory leak in new 3.6 dictionary resize

2016-09-14 Thread Min RK
Changes by Min RK : -- title: Memory leak in dictionary resize -> Memory leak in new 3.6 dictionary resize ___ Python tracker ___