[issue43050] threading timer memory leak

2021-09-24 Thread STINNER Victor
STINNER Victor added the comment: I cannot reproduce the issue. IMO it has been fixed. Moreover, you must join timers using timer.join(): a timer remains a thread. Code: --- import os import threading os.system(f"grep ^VmRSS /proc/{os.getpid()}/status") # warmup for n in range(10): timer

[issue43050] threading timer memory leak

2021-01-27 Thread fengjiang
fengjiang added the comment: yes, I find similar issues,the use the patch(https://github.com/python/cpython/pull/15228/files) to fix the bug -- ___ Python tracker ___

[issue43050] threading timer memory leak

2021-01-27 Thread Martin Panter
Martin Panter added the comment: Perhaps this is caused by Issue 37788. Python 3.7.4 introduced a leak for any thread that doesn't get its "join" method called. Timer is a subclass of Thread, so to confirm, see if calling "timer.join()" after "cancel" will make the leak go away. --

[issue43050] threading timer memory leak

2021-01-27 Thread fengjiang
New submission from fengjiang : Hi,we are transfering code from python2.7 to 3.7 and find that using threading.timer will cause memory leak. It works fine in python2.7 but not 3.7. To repreduce the problem, you can simply run the code below. While True: timer = threading.Timer(5, None)