[issue25554] memory leak (reference cycles) using re

2015-11-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.4 ___ Python tracker ___ __

[issue25554] memory leak (reference cycles) using re

2015-11-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f4fca8f13a2 by Serhiy Storchaka in branch '3.5': Issue #25554: Got rid of circular references in regular expression parsing. https://hg.python.org/cpython/rev/7f4fca8f13a2 New changeset 8621727dd9f7 by Serhiy Storchaka in branch 'default': Issue #2

[issue25554] memory leak (reference cycles) using re

2015-11-05 Thread Jeroen van der Heijden
Jeroen van der Heijden added the comment: Thanks Serhiy, I totally agree with your solution. Using a list with subpattern widths is definitely better compared to using weakref. -- ___ Python tracker _

[issue25554] memory leak (reference cycles) using re

2015-11-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report and patch Jeroen. Indeed, there is a regression, and your patch fixes it. But I don't like the idea of using weakref. For now sre_parse has very little dependencies, but weakref depends on collections that depends on a number of mod

[issue25554] memory leak (reference cycles) using re

2015-11-05 Thread Jeroen van der Heijden
New submission from Jeroen van der Heijden: When compiling a regular expression with groups (subpatterns), circular references are created. Here is an example to illustrate the problem: >>> import gc >>> import re >>> gc.disable() # disable garbage collector >>> gc.collect() # make sure we star