Python subprocess.Popen erroring with OSError: [Errno 12] Cannot allocate memory after period of time

前端 未结 9 1652
南方客
南方客 2020-12-06 01:53

Note: This question has been re-asked with a summary of all debugging attempts here.


I have a Python script that is running as a background pr

9条回答
  •  不知归路
    2020-12-06 02:51

    You need to

    ps = subprocess.Popen(["sleep", "1000"])
    os.waitpid(ps.pid, 0)
    

    to free resources.

    Note: this does not work on Windows.

提交回复
热议问题