INADA Naoki added the comment: I tried this patch with attached script.
``` $ venv/bin/pip install django flask sqlalchemy $ PYTHONTRACEMALLOC=5 venv/bin/python3 tuplemem.py > tuples.txt $ sort tuples.txt | uniq -c | sort -nr > tuplecount ``` ## default memory: (32254693, 32292635) tuples: 64968 head -n10 tuplecount-default 5479 (None,) 3069 ('self',) 727 (<class 'object'>,) 688 ('__class__',) 321 ('NotImplementedError',) 287 ('self', 'other') 264 (None, None) 207 (False,) 193 (None, 0) 176 (None, False) ## patched memory: (31224697, 31261892) tuples: 51298 head -n10 tuplecount-patched 1437 (None,) 727 (<class 'object'>,) 328 ('self',) 264 (None, None) 207 (False,) 193 (None, 0) 138 ('__class__',) 114 (True,) 112 (None, False) 110 ('target', 'fn') I'll try again with my company's private codebase in next week. ---------- Added file: http://bugs.python.org/file46367/tuplemem.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29336> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com