[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2019-04-27 Thread STINNER Victor
STINNER Victor added the comment: The 3.6 branch no longer accept bugfixes. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2019-04-27 Thread Stefan Behnel
Stefan Behnel added the comment: This ticket looks like it's done for 3.7/8. Can it be closed? I guess 3.6 isn't relevant anymore, right? -- ___ Python tracker ___

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2019-04-27 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 ___ Python tracker ___

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-18 Thread miss-islington
miss-islington added the comment: New changeset 60c919b58bd3cf8730947a00ddc6a527d6922ff1 by Miss Islington (bot) in branch '3.7': bpo-35502: Fix reference leaks in ElementTree.TreeBuilder. (GH-11170) https://github.com/python/cpython/commit/60c919b58bd3cf8730947a00ddc6a527d6922ff1

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +10453 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d2a75c67830d7c9f59e4e9b60f36974234c829ef by Serhiy Storchaka in branch 'master': bpo-35502: Fix reference leaks in ElementTree.TreeBuilder. (GH-11170) https://github.com/python/cpython/commit/d2a75c67830d7c9f59e4e9b60f36974234c829ef

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not easy to avoid reference cycles if use a generator function. And generator function is much faster than an implementation as a class with the __next__ method. We need to access the iterator object from the code of the generator function, and this

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-18 Thread STINNER Victor
STINNER Victor added the comment: Oops, my PR 11169 used the wrong issue number: bpo-35257 instead of bpo-35502. Anyway, I closed it, the change is too complex. -- IMHO the root issue is the handling of the SyntaxError exception in XMLPullParser.feed(). I wrote a fix, but I don't have the

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread Jess Johnson
Change by Jess Johnson : -- versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +10408 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem was with detecting a reference cycle containing a TreeBuilder. -- nosy: +eli.bendersky, scoder versions: +Python 3.8 ___ Python tracker

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +10407 stage: -> patch review ___ Python tracker ___ ___

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread STINNER Victor
STINNER Victor added the comment: Oops, there was a typo, you should read kB: 1 calls: 15.3 kB / call (total: 15.3 kB) 100 calls: 15.3 kB / call (total: 1527.7 kB) 1000 calls: 15.3 kB / call (total: 15265.0 kB) -- Added file: https://bugs.python.org/file47999/run2.py

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread STINNER Victor
Change by STINNER Victor : Removed file: https://bugs.python.org/file47998/run.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread STINNER Victor
STINNER Victor added the comment: I wrote attached run.py which confirms a leak using tracemalloc: $ python3 run.py 1 calls: 15.3B / call (total: 15.3 kB) 100 calls: 15.3B / call (total: 1527.7 kB) 1000 calls: 15.3B / call (total: 15265.0 kB) -- nosy: +vstinner Added file:

[issue35502] Memory leak in xml.etree.ElementTree.iterparse

2018-12-14 Thread Jess Johnson
New submission from Jess Johnson : When given xml that that would raise a ParseError, but parsing is stopped before the ParseError is raised, xml.etree.ElementTree.iterparse leaks memory. Example: import gc from io import StringIO import xml.etree.ElementTree as etree import objgraph def