Python memory allocation error using subprocess.Popen

后端 未结 4 1219
清歌不尽
清歌不尽 2020-12-06 12:08

I am doing some bioinformatics work. I have a python script that at one point calls a program to do an expensive process (sequence alignment..uses a lot of computational pow

4条回答
  •  粉色の甜心
    2020-12-06 12:43

    This doesn't have anything to do with Python or the subprocess module. subprocess.Popen is merely reporting to you the error that it is receiving from the operating system. (What operating system are you using, by the way?) From man 2 fork on Linux:

    ENOMEM    fork()  failed  to  allocate  the  necessary  kernel  structures
              because memory is tight.
    

    Are you calling subprocess.Popen multiple times? If so then I think the best you can do is make sure that the previous invocation of your process is terminated and reaped before the next invocation.

提交回复
热议问题