Running vmstat will give you the average virtual memory usage since last reboot. The si and so values give the average virtual memory I/O. For example:
root@mymachine# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 304 300236 244940 967828 0 0 0 1 2 1 0 0 100 0 0
As Ijaz Khan answered, I can how many times I want vmstat to run, as well as the increments in between. This is useful in some cases (+1), but I do not want to have to leave vmstat running.
I want to be able collect the data, then reset the counters so I can leave it for a while, then come back to get an average of from when I reset the counters to when I next check -- instead of since the last boot. Is that possible?