運行寫的不太完善的爬蟲程序, 未限制任務隊列大小, 再加上本子配置不高, 爬取網站到第3層大半時, 內存不足了...
進程運行太猛, 導致系統 out of memory, 那么此進程被系統的oom killer殺死.
此時終端顯示 "Killed" 或 "已殺死".
查看相關信息的命令:
dmesg | egrep -i -B100 'killed process'
或:
egrep -i 'killed process' /var/log/messages
egrep -i -r 'killed process' /var/log
或:
journalctl -xb | egrep -i 'killed process'
結果類似這樣:
4月 07 10:48:58 arch kernel: Out of memory: Kill process 1245 (python) score 685 or sacrifice child
4月 07 10:48:58 arch kernel: Killed process 1245 (python) total-vm:3519016kB, anon-rss:2453976kB, file-rss:0kB
參考:
http://stackoverflow.com/questions/726690/who-killed-my-process-and-why
http://stackoverflow.com/questions/624857/finding-which-process-was-killed-by-linux-oom-killer
http://unix.stackexchange.com/questions/10077/where-can-i-see-a-list-of-kernel-killed-processes