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

参考:

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值