Wednesday, August 19, 2009

top sort by memory usage

SkyHi @ Wednesday, August 19, 2009
Press "M" in top to sort by memory usage.


HTTP/1.1" 400 226 "-" "-"
[root@home ~]# top
top - 11:29:33 up 74 days, 23:50, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 77 total, 2 running, 75 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1026648k total, 981304k used, 45344k free, 438656k buffers
Swap: 2031608k total, 4k used, 2031604k free, 436956k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28410 root 18 0 25960 10m 5484 S 0.0 1.1 0:02.07 httpd
1335 apache 15 0 26092 7208 1632 S 0.0 0.7 0:00.04 httpd
1331 apache 18 0 25960 6920 1428 S 0.0 0.7 0:00.01 httpd
1333 apache 15 0 25960 6920 1428 S 0.0 0.7 0:00.02 httpd
1334 apache 15 0 25960 6920 1428 S 0.0 0.7 0:00.02 httpd
1336 apache 15 0 25960 6920 1428 S 0.0 0.7 0:00.02 httpd
1332 apache 18 0 25960 6912 1420 S 0.0 0.7 0:00.02 httpd
1359 apache 15 0 25960 6892 1404 S 0.0 0.7 0:00.02 httpd
1360 apache 15 0 25960 6892 1404 S 0.0 0.7 0:00.02 httpd
1982 root 18 0 71836 4040 1692 S 0.0 0.4 0:09.83 fail2ban-server
2355 haldaemo 17 0 5528 3688 1636 S 0.0 0.4 0:00.63 hald
339 root 18 0 14464 3188 2420 S 0.0 0.3 0:00.17 smbd
3349 root 15 0 10052 2836 2276 R 0.0 0.3 0:00.08 sshd
1725 root 18 0 14456 2696 1984 S 0.0 0.3 0:00.00 smbd
14521 root 18 0 14092 2456 1792 S 0.0 0.2 0:00.01 smbd
32036 root 15 0 9000 1852 780 S 0.0 0.2 0:01.53 sendmail
3351 root 15 0 4660 1516 1248 S 0.0 0.1 0:00.01 bash
14524 root 15 0 9460 1516 1020 S 0.0 0.1 0:05.95 nmbd
32044 smmsp 18 0 8048 1496 644 S 0.0 0.1 0:00.07 sendmail
2091 root 25 0 12880 1336 1044 S 0.0 0.1 0:00.02 automount
2295 root 15 0 2552 1148 936 S 0.0 0.1 0:08.61 gam_server
2248 root 18 0 5260 1116 580 S 0.0 0.1 0:00.08 crond
27281 root 18 0 7044 1056 668 S 0.0 0.1 0:07.77 sshd
6370 root 15 0 2192 996 808 R 0.0 0.1 0:00.17 top
2356 root 25 0 3132 980 832 S 0.0 0.1 0:00.00 hald-runner
14526 root 25 0 14092 936 276 S 0.0 0.1 0:00.00 smbd
2375 haldaemo 22 0 1996 796 708 S 0.0 0.1 0:00.00 hald-addon-acpi
2379 haldaemo 22 0 1992 780 696 S 0.0 0.1 0:00.00 hald-addon-keyb
2046 dbus 19 0 2748 772 604 S 0.0 0.1 0:00.00 dbus-daemon
1986 rpcuser 25 0 1852 724 624 S 0.0 0.1 0:00.00 rpc.statd
1890 root 12 -3 12052 720 568 S 0.0 0.1 0:01.26 audispd
1888 root 16 -3 12128 676 496 S 0.0 0.1 0:03.60 auditd
425 root 21 -4 2236 636 396 S 0.0 0.1 0:00.44 udevd




[root@home ~]# ps -elf |awk '{print $10,$3,$4,$15,16'}|sort -nr |more
17959 root 1982 /usr/bin/python 16
7344 root 6381 sort 16
6523 apache 1335 /usr/sbin/httpd 16
6490 root 28410 /usr/sbin/httpd 16
6490 apache 1360 /usr/sbin/httpd 16
6490 apache 1359 /usr/sbin/httpd 16
6490 apache 1336 /usr/sbin/httpd 16
6490 apache 1334 /usr/sbin/httpd 16
6490 apache 1333 /usr/sbin/httpd 16
6490 apache 1332 /usr/sbin/httpd 16
6490 apache 1331 /usr/sbin/httpd 16
3616 root 339 smbd 16
3614 root 1725 smbd 16
3523 root 14526 smbd 16
3523 root 14521 smbd 16
3220 root 2091 automount 16
3032 root 1888 auditd 16
3013 root 1890 /sbin/audispd 16
2513 root 3349 sshd: 16
2365 root 14524 nmbd 16
2250 root 32036 sendmail: 16
2012 smmsp 32044 sendmail: 16
1761 root 27281 /usr/sbin/sshd 16
1382 68 2355 hald 16
1359 root 2019 rpc.idmapd 16
1315 root 2248 crond 16
1271 root 2184 /usr/sbin/vsftpd 16
1165 root 6382 -bash 16
1165 root 3351 -bash 16
1122 bb 4335 /bin/sh 16
1062 root 6379 ps 16
1055 root 6380 awk 16
783 root 2356 hald-runner 16
687 dbus 2046 dbus-daemon 16
638 root 2295 /usr/libexec/gam_server 16
561 root 2340 /usr/sbin/atd 16
559 root 425 /sbin/udevd 16
515 root 1 init 16
499 68 2375 hald-addon-acpi: 16