[排错] Linux 解决运行时报错 “oom-killer……”、“Out of memory……” 或者 “mems_allowed=0”

报错代码:

1) oom-killer
2) Out of memory: Kill process 10001 (nginx) score 3 or sacrifice child
3) mems_allowed=0

分析:

1) 系统出现了内存不足的情况
2) 占用内存最大的进程被系统杀死了

解决方法:

1) 增加内存
2) 限制应用可使用的最大内存