memory usage for a process linux

You can find out how much memory a process in linux is using by using the “top” command. While top is running interactively use “shift + m” and it will display how much memory a process is using


top - 10:05:56 up 28 days, 15:36,  2 users,  load average: 0.26, 0.06, 0.02
Tasks:  91 total,   2 running,  89 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  7.5%sy,  0.0%ni,  0.0%id, 90.6%wa,  0.3%hi,  1.4%si,  0.0%st
Mem:   1035104k total,   949740k used,    85364k free,   202876k buffers
Swap:  1534196k total,        0k used,  1534196k free,   630724k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
17162 root      18   0 40780  20m  644 D  7.6  2.1   0:01.18 someprogram
 2917 root      34  19 26840  11m 2160 S  0.0  1.1   0:16.97 yum-updatesd
 2350 root      18   0 12204  10m  316 S  0.0  1.0   0:00.52 restorecond
 2635 haldaemo  15   0  6300 4384 1688 S  0.0  0.4   1:08.27 hald
17097 root      22   0 10052 2948 2376 R  0.0  0.3   0:00.10 sshd
17126 root      16   0 10052 2936 2372 S  0.3  0.3   0:00.25 sshd
 2741 root      18   0 10236 2348 1712 S  0.0  0.2   0:00.01 cupsd
 2795 root      18   0  9344 1904  804 S  0.0  0.2   0:01.19 sendmail
 2817 smmsp     18   0  8252 1492  616 S  0.0  0.1   0:00.17 sendmail
17128 root      15   0  4732 1468 1200 S  0.0  0.1   0:00.00 bash
  579 root      17  -4  2988 1452  488 S  0.0  0.1   0:00.71 udevd
17099 root      15   0  4632 1412 1176 S  0.0  0.1   0:00.00 bash
 2704 root      22   0 29412 1380 1060 S  0.0  0.1   0:00.72 automount
 2605 root      24   0 12824 1344  608 S  0.0  0.1   0:03.96 pcscd
 2896 avahi     16   0  2688 1276 1096 S  0.0  0.1   0:00.52 avahi-daemon

The processes occupying the most memory will be displayed first. the someprogram using 2.1% of the system memory, approximately 20MB.

Be the first to comment

Leave a Reply