700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 查看被Linux干掉的进程 Linux 查看进程被杀死的详情

查看被Linux干掉的进程 Linux 查看进程被杀死的详情

时间:2022-07-15 16:40:53

相关推荐

查看被Linux干掉的进程 Linux 查看进程被杀死的详情

运行写的不太完善的爬虫程序, 未限制任务队列大小, 再加上本子配置不高, 爬取网站到第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

参考:

/questions/726690/who-killed-my-process-and-why

/questions/624857/finding-which-process-was-killed-by-linux-oom-killer

/questions/10077/where-can-i-see-a-list-of-kernel-killed-processes

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。