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

前端 未结 9 1647
南方客
南方客 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:48

    You might want to actually wait for all of those PS processes to finish before adding swap space.

    It's not at all clear what "running as a background process executing every 60 seconds" means.

    But your call to subprocess.Popen is forking a new process each time.

    Update.

    I'd guess that you're somehow leaving all those processes running or hung in a zombie state. However, the communicate method should clean up the spawned subprocesses.

提交回复
热议问题