Huuuuge memory leak (third attempt)

jurgen.defurne at jurgen.defurne at
Tue Feb 20 14:54:57 CET 2001

If I were using Linux/Python 2.0, I would preferably use fork()/exec().
Unfortunately, that is not the case.

The MS documentation about spawn does not mention anything about
waiting for termination of the proces. Besides, the _cwait call, which
acts on the process handle, is not implemented in Python, os.waitpid()
is only available on U*ix systems.

So, yes, I will try to write the same functionality in C, and look what that

Thank you very much.


jepler at at on 20/02/2001 14:31:50
Sent by:	python-list-admin at
To:	python-list at
Subject:	Re: Huuuuge memory leak (third attempt)

On Mon, 19 Feb 2001 09:12:40 +0100, jurgen.defurne at
 <jurgen.defurne at> wrote:
>Thanks, everybody,
>for the comments on the multiple assignment. Unfortunately,
>that was the least of my problems.

I would suggest entering this bug in the bug tracking system at
This may be a genuine bug.

Another thing you could do is try the equivalent program written in
C on Windows NT, to see if it exhibits the problem.  It is possible
that this is a bug in Windows, not in Python.

I don't know what the equivalent of "/bin/false" is in Windows NT, but
does the result change if a more trivial program is executed?

Running the following code on Linux/Python 2.0, I soon get an error
due to the number of "zombie" processes.  "zombie" processes are those
whose exit codes have not been read by the waitpid() or wait() functions
in the os module.  Is something like "waitpid()" necessary/possible under
NT?  Adding waitpid() lets it run seemingly forever without error.

import os, time

while 1:
        pid = os.spawnv(os.P_NOWAIT, "false", "/bin/false")
        #print pid, os.waitpid(pid, 0)


More information about the Python-list mailing list