free -g
以下はとの出力ですps -aux
。 35GのRAMが使用されていることを示していますが、どのプロセスが最も多くのメモリを消費しているかを出力からどのように知ることができるかfree
わかりません。ps
total used free shared buffers cached
Mem: 54 35 18 0 0 1
-/+ buffers/cache: 34 20
Swap: 8 0 8
[opc@lapp203 ~]$ ps -aux
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 19416 2316 ? Ss Mar17 0:01 /sbin/init
root 2 0.0 0.0 0 0 ? S Mar17 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/0:0H]
root 7 0.0 0.0 0 0 ? S Mar17 0:16 [rcu_sched]
root 8 0.0 0.0 0 0 ? S Mar17 0:00 [rcu_bh]
root 9 0.0 0.0 0 0 ? S Mar17 0:03 [rcuos/0]
root 10 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/0]
root 11 0.0 0.0 0 0 ? S Mar17 0:00 [migration/0]
root 12 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/0]
root 13 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/1]
root 14 0.0 0.0 0 0 ? S Mar17 0:00 [migration/1]
root 15 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/1]
root 17 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/1:0H]
root 18 0.0 0.0 0 0 ? S Mar17 0:02 [rcuos/1]
root 19 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/1]
root 20 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/2]
root 21 0.0 0.0 0 0 ? S Mar17 0:00 [migration/2]
root 22 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/2]
root 24 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/2:0H]
root 25 0.0 0.0 0 0 ? S Mar17 0:03 [rcuos/2]
root 26 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/2]
root 27 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/3]
root 28 0.0 0.0 0 0 ? S Mar17 0:00 [migration/3]
root 29 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/3]
root 31 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/3:0H]
root 32 0.0 0.0 0 0 ? S Mar17 0:02 [rcuos/3]
root 33 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/3]
root 34 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/4]
root 35 0.0 0.0 0 0 ? S Mar17 0:00 [migration/4]
root 36 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/4]
root 38 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/4:0H]
root 39 0.0 0.0 0 0 ? S Mar17 0:03 [rcuos/4]
root 40 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/4]
root 41 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/5]
root 42 0.0 0.0 0 0 ? S Mar17 0:00 [migration/5]
root 43 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/5]
root 45 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/5:0H]
root 46 0.0 0.0 0 0 ? S Mar17 0:02 [rcuos/5]
root 47 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/5]
root 48 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/6]
root 49 0.0 0.0 0 0 ? S Mar17 0:00 [migration/6]
root 50 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/6]
root 52 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/6:0H]
root 53 0.0 0.0 0 0 ? S Mar17 0:08 [rcuos/6]
root 54 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/6]
root 55 0.0 0.0 0 0 ? S Mar17 0:00 [watchdog/7]
root 56 0.0 0.0 0 0 ? S Mar17 0:00 [migration/7]
root 57 0.0 0.0 0 0 ? S Mar17 0:00 [ksoftirqd/7]
root 59 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/7:0H]
root 60 0.0 0.0 0 0 ? S Mar17 0:02 [rcuos/7]
root 61 0.0 0.0 0 0 ? S Mar17 0:00 [rcuob/7]
root 62 0.0 0.0 0 0 ? S< Mar17 0:00 [khelper]
root 63 0.0 0.0 0 0 ? S Mar17 0:00 [kdevtmpfs]
root 64 0.0 0.0 0 0 ? S< Mar17 0:00 [netns]
root 65 0.0 0.0 0 0 ? S< Mar17 0:00 [perf]
root 66 0.0 0.0 0 0 ? S Mar17 0:00 [khungtaskd]
root 67 0.0 0.0 0 0 ? S< Mar17 0:00 [writeback]
root 68 0.0 0.0 0 0 ? SN Mar17 0:00 [ksmd]
root 69 0.0 0.0 0 0 ? SN Mar17 0:00 [khugepaged]
root 70 0.0 0.0 0 0 ? S< Mar17 0:00 [crypto]
root 71 0.0 0.0 0 0 ? S< Mar17 0:00 [kintegrityd]
root 72 0.0 0.0 0 0 ? S< Mar17 0:00 [bioset]
root 73 0.0 0.0 0 0 ? S< Mar17 0:00 [kblockd]
root 74 0.0 0.0 0 0 ? S< Mar17 0:00 [ata_sff]
root 75 0.0 0.0 0 0 ? S< Mar17 0:00 [md]
root 76 0.0 0.0 0 0 ? S Mar17 0:00 [kworker/0:1]
root 78 0.0 0.0 0 0 ? S Mar17 0:00 [kswapd0]
root 79 0.0 0.0 0 0 ? S Mar17 0:00 [fsnotify_mark]
root 91 0.0 0.0 0 0 ? S< Mar17 0:00 [kthrotld]
root 92 0.0 0.0 0 0 ? S< Mar17 0:00 [acpi_thermal_pm]
root 94 0.0 0.0 0 0 ? S Mar17 0:02 [kworker/2:1]
root 95 0.0 0.0 0 0 ? S< Mar17 0:00 [kpsmoused]
root 97 0.0 0.0 0 0 ? S< Mar17 0:00 [bcache]
root 98 0.0 0.0 0 0 ? S< Mar17 0:00 [deferwq]
root 99 0.0 0.0 0 0 ? S Mar17 0:00 [kworker/1:1]
root 100 0.0 0.0 0 0 ? S Mar17 0:00 [kworker/3:1]
root 101 0.0 0.0 0 0 ? S Mar17 0:08 [kworker/5:1]
root 102 0.0 0.0 0 0 ? S Mar17 0:01 [kworker/6:1]
root 103 0.0 0.0 0 0 ? S Mar17 0:02 [kworker/7:1]
root 138 0.0 0.0 0 0 ? S< Mar17 0:00 [iscsi_eh]
root 182 0.0 0.0 0 0 ? S< Mar17 0:00 [ttm_swap]
root 319 0.0 0.0 0 0 ? S Mar17 0:00 [scsi_eh_0]
root 320 0.0 0.0 0 0 ? S< Mar17 0:00 [scsi_tmf_0]
root 321 0.0 0.0 0 0 ? S Mar17 0:00 [scsi_eh_1]
root 322 0.0 0.0 0 0 ? S< Mar17 0:00 [scsi_tmf_1]
root 326 0.0 0.0 0 0 ? S< Mar17 0:00 [ib_addr]
root 327 0.0 0.0 0 0 ? S< Mar17 0:00 [ixgbevf]
root 328 0.0 0.0 0 0 ? S< Mar17 0:00 [iw_cxgb3]
root 332 0.0 0.0 0 0 ? S< Mar17 0:00 [iw_cm_wq]
root 333 0.0 0.0 0 0 ? S< Mar17 0:00 [iw_cxgb4]
root 334 0.0 0.0 0 0 ? S< Mar17 0:00 [cnic_wq]
root 335 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/0]
root 336 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/1]
root 337 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/2]
root 338 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/3]
root 339 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/4]
root 340 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/5]
root 341 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/6]
root 342 0.0 0.0 0 0 ? S< Mar17 0:00 [bnx2i_thread/7]
root 549 0.0 0.0 0 0 ? S Mar17 0:00 [scsi_eh_2]
root 550 0.0 0.0 0 0 ? S< Mar17 0:00 [scsi_tmf_2]
root 551 0.0 0.0 0 0 ? S< Mar17 0:00 [iscsi_q_2]
root 552 0.0 0.0 0 0 ? S< Mar17 0:00 [scsi_wq_2]
root 631 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/5:1H]
root 638 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/2:1H]
root 639 0.0 0.0 0 0 ? S Mar17 0:01 [jbd2/sda3-8]
root 640 0.0 0.0 0 0 ? S< Mar17 0:00 [ext4-rsv-conver]
root 647 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/7:1H]
root 649 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/6:1H]
root 651 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/0:1H]
root 653 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/4:1H]
root 721 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/1:1H]
root 746 0.0 0.0 11608 2744 ? S<s Mar17 0:00 /sbin/udevd -d
root 769 0.0 0.0 0 0 ? S< Mar17 0:00 [kworker/3:1H]
root 815 0.0 0.0 0 0 ? S Mar18 0:00 [kworker/6:2]
root 3351 0.0 0.0 0 0 ? S Mar17 0:00 [kauditd]
root 3394 0.0 0.0 0 0 ? S< Mar17 0:00 [ib_mcast]
root 3395 0.0 0.0 0 0 ? S< Mar17 0:00 [ib_nl_sa_wq]
root 3396 0.0 0.0 0 0 ? S< Mar17 0:00 [ib_cm]
root 3397 0.0 0.0 0 0 ? S< Mar17 0:00 [rdma_cm]
root 3398 0.0 0.0 0 0 ? S< Mar17 0:00 [rdma_cm_fr]
root 3406 0.0 0.0 24936 18768 ? S<Lsl Mar17 0:00 iscsiuio
root 3412 0.0 0.0 4996 1520 ? Ss Mar17 0:03 iscsid
root 3413 0.0 0.0 8624 4536 ? S<Ls Mar17 0:12 iscsid
root 3622 0.0 0.0 9176 2212 ? Ss Mar17 0:00 /sbin/dhclient -H phxalc5lapp203 -1 -q -lf /var/lib/d
root 3672 0.0 0.0 27776 1788 ? S<sl Mar17 0:00 auditd
root 3706 0.0 0.0 245128 2804 ? Ssl Mar17 0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
root 3721 0.0 0.0 18312 1884 ? Ss Mar17 0:07 irqbalance --pid=/var/run/irqbalance.pid
root 3736 0.0 0.0 0 0 ? S Mar17 0:00 [scsi_eh_4]
root 3737 0.0 0.0 0 0 ? S< Mar17 0:00 [scsi_tmf_4]
root 3738 0.0 0.0 0 0 ? S< Mar17 0:00 [iscsi_q_4]
root 3739 0.0 0.0 0 0 ? S< Mar17 0:00 [scsi_wq_4]
rpc 3776 0.0 0.0 19040 1928 ? Ss Mar17 0:00 rpcbind
rpcuser 3800 0.0 0.0 23412 2456 ? Ss Mar17 0:00 rpc.statd
root 3832 0.0 0.0 0 0 ? S< Mar17 0:00 [rpciod]
root 3837 0.0 0.0 23160 192 ? Ss Mar17 0:00 rpc.idmapd
dbus 3863 0.0 0.0 29980 2620 ? Ssl Mar17 0:00 dbus-daemon --system
root 3885 0.0 0.0 189144 6488 ? Ss Mar17 0:00 cupsd -C /etc/cups/cupsd.conf
root 3909 0.0 0.0 0 0 ? S< Mar17 0:00 [kdmflush]
root 3910 0.0 0.0 0 0 ? S< Mar17 0:00 [bioset]
root 3927 0.0 0.0 0 0 ? S< Mar17 0:00 [nfsiod]
root 3939 0.0 0.0 0 0 ? S Mar17 0:00 [nfsv4.0-svc]
root 3941 0.0 0.0 0 0 ? S Mar17 0:00 [jbd2/dm-0-8]
root 3942 0.0 0.0 0 0 ? S< Mar17 0:00 [ext4-rsv-conver]
root 3954 0.0 0.0 4156 1636 ? Ss Mar17 0:00 /usr/sbin/acpid
68 3966 0.0 0.0 37216 5688 ? Ssl Mar17 0:00 hald
root 3967 0.0 0.0 20456 2796 ? S Mar17 0:00 hald-runner
root 4005 0.0 0.0 22576 1060 ? S Mar17 0:00 hald-addon-input: Listening on /dev/input/event1 /dev
68 4010 0.0 0.0 18060 2108 ? S Mar17 0:00 hald-addon-acpi: listening on acpid socket /var/run/a
root 4011 0.0 0.0 0 0 ? S Mar17 0:00 [kworker/5:2]
root 4095 0.0 0.0 66316 2552 ? Ss Mar17 0:00 /usr/sbin/sshd
ntp 4108 0.0 0.0 30800 4240 ? Ss Mar17 0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root 4199 0.0 0.0 81012 6240 ? Ss Mar17 0:00 /usr/libexec/postfix/master
postfix 4216 0.0 0.0 81264 6312 ? S Mar17 0:00 qmgr -l -t fifo -u
root 4217 0.0 0.0 116892 2480 ? Ss Mar17 0:00 crond
root 4236 0.0 0.0 21164 216 ? Ss Mar17 0:00 /usr/sbin/atd
root 4260 0.0 0.0 35512 5600 ? Ssl Mar17 0:03 /opt/Tanium/TaniumClient/TaniumClient
root 4294 0.0 0.0 200940 12048 pts/1 Ss+ Mar17 0:23 /usr/local/qualys/cloud-agent/bin/qualys-cloud-agent
root 4306 0.0 0.0 4124 1356 tty1 Ss+ Mar17 0:00 /sbin/mingetty /dev/tty1
root 4308 0.0 0.0 4124 1332 tty2 Ss+ Mar17 0:00 /sbin/mingetty /dev/tty2
root 4310 0.0 0.0 4124 1404 tty3 Ss+ Mar17 0:00 /sbin/mingetty /dev/tty3
root 4313 0.0 0.0 12528 3744 ? S< Mar17 0:00 /sbin/udevd -d
root 4314 0.0 0.0 4124 1304 tty4 Ss+ Mar17 0:00 /sbin/mingetty /dev/tty4
root 4316 0.0 0.0 4124 1192 tty5 Ss+ Mar17 0:00 /sbin/mingetty /dev/tty5
root 4318 0.0 0.0 4124 1344 tty6 Ss+ Mar17 0:00 /sbin/mingetty /dev/tty6
root 6092 0.0 0.0 0 0 ? S 01:00 0:00 [kworker/3:0]
root 7272 0.0 0.0 0 0 ? S Mar17 0:00 [kworker/1:2]
root 11979 0.0 0.0 0 0 ? S Mar18 0:00 [kworker/4:0]
root 19550 0.0 0.0 0 0 ? S Mar18 0:00 [kworker/2:0]
root 23050 0.0 0.0 0 0 ? S Mar18 0:00 [kworker/4:2]
root 23146 0.0 0.0 0 0 ? S Mar18 0:00 [kworker/0:0]
root 26106 0.1 0.0 963224 28744 ? Sl 02:47 0:07 /opt/Tanium/TaniumClient/TaniumClient -c
root 26636 0.0 0.0 0 0 ? S 03:13 0:00 [kworker/u16:2]
postfix 26651 0.0 0.0 81092 6260 ? S 03:16 0:00 pickup -l -t fifo -u
root 27085 0.0 0.0 97992 6324 ? Ss 03:34 0:00 sshd: arwadmin [priv]
arwadmin 27093 0.0 0.0 97992 5200 ? S 03:34 0:00 sshd: arwadmin@pts/3
arwadmin 27103 0.0 0.0 108380 3196 pts/3 Ss+ 03:35 0:00 -bash
root 27176 0.0 0.0 97992 6204 ? Ss 03:40 0:00 sshd: opc [priv]
opc 27184 0.0 0.0 97992 3440 ? S 03:40 0:00 sshd: opc@pts/4
opc 27185 0.0 0.0 108380 3180 pts/4 Ss 03:40 0:00 -bash
root 27223 0.0 0.0 97992 6232 ? Ss 03:42 0:00 sshd: ppdsoa [priv]
ppdsoa 27231 0.0 0.0 97992 4944 ? S 03:42 0:00 sshd: ppdsoa@pts/5
ppdsoa 27246 0.0 0.0 108512 3260 pts/5 Ss 03:42 0:00 -bash
root 27445 0.0 0.0 97992 6216 ? Ss 03:47 0:00 sshd: ppdsoa [priv]
ppdsoa 27450 0.0 0.0 97992 3316 ? S 03:47 0:00 sshd: ppdsoa@pts/0
ppdsoa 27451 0.0 0.0 108512 3264 pts/0 Ss+ 03:47 0:00 -bash
ppdsoa 27480 0.0 0.0 218936 41004 pts/0 Sl 03:47 0:00 /usr/bin/Xvnc :3 -desktop phxalc5lapp203:3 (ppdsoa) -
ppdsoa 27496 0.0 0.0 50276 4556 pts/0 S 03:47 0:00 vncconfig -iconic
ppdsoa 27500 0.0 0.0 253768 13700 pts/0 Sl 03:47 0:00 gnome-session
ppdsoa 27503 0.0 0.0 20120 1980 pts/0 S 03:47 0:00 dbus-launch --exit-with-session gnome-session
ppdsoa 27504 0.0 0.0 29948 2476 ? Ssl 03:47 0:00 /bin/dbus-daemon --fork --print-pid 5 --print-address
root 27508 0.0 0.0 49992 4976 ? S 03:47 0:00 /usr/libexec/devkit-power-daemon
ppdsoa 27512 0.0 0.0 132684 6732 ? S 03:47 0:00 /usr/libexec/gconfd-2
ppdsoa 27531 0.0 0.0 555020 17812 ? Ss 03:47 0:00 /usr/libexec/gnome-settings-daemon
ppdsoa 27533 0.0 0.0 161828 3772 pts/0 Sl 03:47 0:00 gnome-keyring-daemon --start
ppdsoa 27536 0.0 0.0 284460 15120 ? Ss 03:47 0:00 seahorse-daemon
ppdsoa 27540 0.0 0.0 137452 4544 ? S 03:47 0:00 /usr/libexec/gvfsd
root 27547 0.0 0.0 11604 2404 ? S< 03:47 0:00 /sbin/udevd -d
ppdsoa 27551 0.0 0.0 266860 17700 pts/0 S 03:47 0:00 metacity
ppdsoa 27557 0.0 0.0 358344 5640 ? Ssl 03:47 0:00 /usr/bin/pulseaudio --start --log-target=syslog
rtkit 27559 0.0 0.0 164412 2064 ? SNl 03:47 0:00 /usr/libexec/rtkit-daemon
root 27563 0.0 0.0 52524 6172 ? S 03:47 0:00 /usr/libexec/polkit-1/polkitd
ppdsoa 27564 0.0 0.0 594280 33776 pts/0 S 03:47 0:00 nautilus
root 27566 0.0 0.0 4114656 5080 ? Sl 03:47 0:00 /usr/sbin/console-kit-daemon --no-daemon
ppdsoa 27635 0.0 0.0 253444 14628 pts/0 S 03:47 0:00 /usr/libexec/gdu-notification-daemon
ppdsoa 27638 0.0 0.0 446432 20304 pts/0 S 03:47 0:00 gnome-volume-control-applet
ppdsoa 27640 0.0 0.0 257924 15892 pts/0 S 03:47 0:00 bluetooth-applet
ppdsoa 27644 0.0 0.0 30328 6884 pts/0 S 03:47 0:00 /usr/sbin/restorecond -u
ppdsoa 27654 0.0 0.0 255876 14104 pts/0 S 03:47 0:00 gnome-power-manager
root 27656 0.0 0.0 45532 5144 ? S 03:47 0:00 /usr/libexec/udisks-daemon
root 27662 0.0 0.0 45268 316 ? S 03:47 0:00 udisks-daemon: not polling any devices
ppdsoa 27669 0.0 0.0 144080 5424 ? S 03:47 0:00 /usr/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gvfs
ppdsoa 27674 0.0 0.0 146468 5928 ? S 03:47 0:00 /usr/libexec/gvfs-gdu-volume-monitor
ppdsoa 27679 0.0 0.0 230680 5128 ? Sl 03:47 0:00 /usr/libexec/gvfs-afc-volume-monitor
ppdsoa 27682 0.0 0.0 151056 5116 ? S 03:47 0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
ppdsoa 27687 0.0 0.0 135276 4420 ? S 03:47 0:00 /usr/libexec/gvfsd-metadata
ppdsoa 27691 0.0 0.0 137480 4940 ? S 03:47 0:00 /usr/libexec/gvfsd-burn --spawner :1.8 /org/gtk/gvfs/
root 27696 0.0 0.0 0 0 ? S 03:48 0:00 [kworker/u16:1]
ppdsoa 27873 0.0 0.0 114740 3188 pts/5 S+ 03:54 0:00 vi /u01/ppdsoa/CSDW/Oracle/Middleware/oracle_common/c
root 27989 0.0 0.0 0 0 ? S 03:55 0:00 [kworker/u16:0]
opc 28141 2.0 0.0 110256 2284 pts/4 R+ 03:58 0:00 ps -aux
root 28233 0.0 0.0 0 0 ? S Mar18 0:00 [kworker/7:2]
答え1
man
ページを見ると、ps
実際に知りたかったすべての内容が出力に表示されることがわかります。VSZ virtual memory size of the process in KiB (1024-byte units). Device mappings are currently excluded; this is subject to change. (alias vsize). RSS resident set size, the non-swapped physical memory that a task has used (in kiloBytes). (alias rssize, rsz).
コマンドと一緒に
--sort
コマンドオプションをps
使用して並べ替えることができます。たとえば、vsz
rss
head
ps aux --sort -rss | head
また
ps
、表示する内容と方法を正確に指定してから、出力をawk
人間が読みやすい形式にパイプすることもできます。ps -eo pid,vsz,rss,comm --sort -rss,-vsz | head \ | awk 'NR>1 {$2=int($2/1024)"M";$3=int($3/1024)"M"}{ print;}' \ | column -t