ps aux排序

  sre

按内存升序排列;ps aux --sort=+rss
按内存降序排列;ps aux --sort=-rss
按cpu升序排列;ps aux --sort=+%cpu
为按cpu降序排列。ps aux --sort=-%cpu

查看系统OOM日志:

运行 egrep -i -r 'killed process' /var/log 命令,结果如下:

root@node01 ~]# egrep -i -r 'killed process' /var/log
/var/log/messages-20190616:Jun 11 22:33:51 node01 kernel: Memory cgroup out of memory: Killed process 8289 (pause) total-vm:1020kB, anon-rss:4kB, file-rss:0kB, shmem-rss:0kB
/var/log/messages-20190616:Jun 11 22:35:39 node01 kernel: Memory cgroup out of memory: Killed process 6872 (pause) total-vm:1020kB, anon-rss:4kB, file-rss:0kB, shmem-rss:0kB
/var/log/messages-20190616:Jun 11 22:35:39 node01 kernel: Memory cgroup out of memory: Killed process 5923 (dashboard) total-vm:578404kB, anon-rss:299600kB, file-rss:320kB, shmem-rss:0kB
/var/log/messages-20190616:Jun 14 03:10:49 node01 kernel: Out of memory: Killed process 21695 (java) total-vm:6932088kB, anon-rss:2640752kB, file-rss:0kB, shmem-rss:0kB

也可运行 dmesg,用 dmesg -T查看

LEAVE A COMMENT

Captcha Code