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():
        threading.Timer(1, test, ()).start()


which will invoke subprocess always in a new thread. Using subprocess in a 
loop, or using the timer as above without subprocess will not increase memory 

I have changed the title accordingly

title: The 'subprocess' module leaks memory when called in certain ways -> The 
'subprocess' module leaks 4 kiB memory for each thread

Python tracker <>
Python-bugs-list mailing list

Reply via email to