Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I accurately observe and measure the amount of virtual memory utilization and activity on Linux? I know there is vmstat, but how do I interpret the results? Or, what is better?

share|improve this question
up vote 11 down vote accepted

"vmstat" will tell you what you want to know. The "si" and "so" columns are showing you the amount of memory swapped in / out per interval. Both "vmstat" and "free" can show you the breakdown of memory usage. Rather than copy and paste the text, my answer here gives you some background into what those tools report.

share|improve this answer
perfect. I should have searched for vmstat. Thanks! – randy melder Oct 23 '09 at 2:51

If the thrashing is caused by swapping then this line gives a good number:

vmstat 10 2 | tail -n1 | awk  '{print $7*$8}'

If the computer is swapping out, it may be OK. If the computer is swapping in, that may be OK, too. But if the computer is both swapping in and swapping out then it is bad.

share|improve this answer

Another useful tool is atop, which gives more detailed views of I/O than plain old top.

share|improve this answer

Have you gone thru the manpage?

man vmstat

If you need historical information, I use kSar. It has the additional useful ability that it can be run on a remote machine and gather information directly via ssh.

share|improve this answer

One of the great linux dilemmas is knowing which tool to use. I guess that's one of the reasons I wrote collectl over 5 years ago. It combines the best of most other tools to combine just about all other them into one. In fact, it provides alternate formats of output so if you like vmstat output you just run "collectl --vmstat". So why not just run vmstat? Thats easy - collectl can also record data like sar but play it back to look like vmstat! It will even play it back in a format which you can directly feed to gnuplot (see collectl-utils) or you can load it into exel or even RRD if you want to go that route.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.