Memory statistics

Linux

vmstat – Report virtual memory statistics

-bash-4.1$ vmstat 2 2
procs ———–memory———- —swap– —–io—- –system– —–cpu—–
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 34592 252684 380212 12877492 0 0 0 4 1 0 0 0 99 0 0
0 0 34592 252404 380212 12877500 0 0 0 28 1354 2324 1 1 98 1 0

The -a switch displays active/inactive memory
-bash-4.1$ vmstat -a 2 2
procs ———–memory———- —swap– —–io—- –system– —–cpu—–
r b swpd free inact active si so bi bo in cs us sy id wa st
1 0 34592 249892 5960060 9481684 0 0 0 4 1 0 0 0 99 0 0
0 0 34592 252364 5960060 9479808 0 0 0 38 1381 2318 1 1 97 1 0

bash-4.1$ vmstat -s | head -5
     16308444  total memory
     16065424  used memory
      9487728  active memory
      5960728  inactive memory
       243020  free memory

-bash-4.1$ vmstat -s
     16308444  total memory
     16059828  used memory
      9483800  active memory
      5960740  inactive memory
       248616  free memory
       380040  buffer memory
     12888236  swap cache
     16777208  total swap
        34564  used swap
     16742644  free swap
      6798076 non-nice user cpu ticks
          364 nice user cpu ticks
      6854965 system cpu ticks
   4555453317 idle cpu ticks
     17462277 IO-wait cpu ticks
           84 IRQ cpu ticks
        92861 softirq cpu ticks
            0 stolen cpu ticks
     12172569 pages paged in
    192073914 pages paged out
          176 pages swapped in
         8661 pages swapped out
   3678491114 interrupts
   2541695328 CPU context switches
   1384438552 boot time
      8634844 forks

The -t switch adds timestamp to the output.

-bash-4.1$ vmstat -t 2
procs ———–memory———- —swap– —–io—- –system– —–cpu—— —timestamp—
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 34592 254800 380176 12876944 0 0 0 4 1 0 0 0 99 0 0 2014-03-27 16:59:02 IST
0 1 34592 253528 380176 12876952 0 0 0 8 1686 2700 2 2 96 0 0 2014-03-27 16:59:04 IST
0 0 34592 254156 380192 12876964 0 0 0 82 1992 2889 2 3 92 2 0 2014-03-27 16:59:06 IST
0 0 34592 254272 380192 12876980 0 0 0 16 1978 2876 2 3 94 0 0 2014-03-27 16:59:08 IST
0 1 34592 251544 380192 12876996 0 0 0 56 2053 2924 3 4 93 0 0 2014-03-27 16:59:10 IST
3 0 34592 252620 380196 12877008 0 0 0 22 1870 2789 3 3 94 1 0 2014-03-27 16:59:12 IST

-bash-4.1$ vmstat -D
26 disks
8 partitions
515703 total reads
72450 merged reads
24343090 read sectors
1482592 milli reading
15825036 writes
32191814 merged writes
384185516 written sectors
564228986 milli writing
0 inprogress IO
203211 milli spent IO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s