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?

5 Answers 5


"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.

  • perfect. I should have searched for vmstat. Thanks!
    – randomx
    Oct 23, 2009 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.


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


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.


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .