STINNER Victor added the comment:
Test-2.py has issues:
* it doesn't call Timer.join()
* it uses a weak synchronization between the main thread and the Timer thread:
see msg276990 for an example using Event
If you use a better synchronization code, call timer.join() and call
gc.collect(),
Xavion added the comment:
haypo: So, what is the result when you run "Test-2.py" and monitor the memory
usage with "Test.sh"?
ztane: The code you've provided is the same as "Test-1.py". You need to run
"Test-2.py" in order to see the bug!
--
___
Antti Haapala added the comment:
The title of the issue is still wrong. As I noted before the problem is not
with subprocess leaking 4K memory *always*. The issue comes from the fact that
subprocess seems to leak 4K memory per individual thread. The test code to use
is thus
def test():