[issue46717] Raising exception multiple times leaks memory

2022-02-22 Thread Irit Katriel
Change by Irit Katriel : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46717] Raising exception multiple times leaks memory

2022-02-11 Thread Irit Katriel
Irit Katriel added the comment: "raise exc" adds the current frame to the traceback of exc. If you want to clear the previous traceback before raising you can do that with raise exc.with_traceback(None) -- resolution: -> not a bug ___ Python

[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Did you try to print a traceback of the exception? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Dennis Sweeney
Dennis Sweeney added the comment: I reproduced as far back as Python 3.6 with this: --- import gc exc = Exception() deltas = [] for i in range(2, 15): ref1 = len(gc.get_objects()) for j in range(2**i): try: raise exc except

[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread Ethan Furman
Change by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46717] Raising exception multiple times leaks memory

2022-02-10 Thread George Gensure
New submission from George Gensure : Instantiating an exception and raising it multiple times causes 1 frame and 2 traceback objects to remain allocated for each raise. The attached example causes python to consume 8GB of ram after a few seconds of execution on Windows/Linux. --