self.pid = os.fork() OSError: [Errno 12] Cannot allocate memory Process finished with exit code 137

The solution is either to make the pools earlier, when less memory needs to be copied, or to work harder at sharing the largest objects. Or, of course, add more memory (perhaps just virtual memory, i.e., swap space) to the system.

解決:
 
排查發現原因:系統的pid_max不夠用了,修改最大進程數後系統恢復

  • 修改最大進程數後系統恢復

echo 1000000 > /proc/sys/kernel/pid_max

 echo 1493909 > /proc/sys/kernel/pid_max

ps:

  • 永久生效

echo "kernel.pid_max=1000000 " >> /etc/sysctl.conf
sysctl -p

https://blog.csdn.net/zqz_zqz/article/details/53384854

  • 永久生效

編輯文件 /etc/sysctl.conf 添加:

vm.overcommit_memory=1

執行sysctl -p使其生效;

ps:出現:    chunk = read(handle, remaining)
ConnectionResetError: [Errno 104] Connection reset by peer

 

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章