The output of vmstat and description of what each field means:
The first line of output from vmstat shows a summary since boot,
followed by the output over the last 3 seconds for each additional line.
The vmstat command reports the amount of swap space that is free (not reserved or allocated). This is the most useful measure.
Swap space is reserved first, then may be allocated. When a process requests memory via malloc() for example, the address space is created, but real pages are not allocated to it. At this point, swap space is reserved, but not allocated. The first time each page is accessed, a real page of memory is allocated to it and swap space is also allocated.
The vmstat paging counters provide us with some insight as to how busy VM system is, and if there are any memory resource issues.
The first thing to look for in the paging counters is the scan rate. The scan rate is the number of pages per second that the pageout scanner is scanning. If the scan rate is consistently zero, then the pageout scanner is not running, and there must be greater than lotsfree free memory. If the scan rate is zero, then there is no memory shortage. A non-zero scan rate does not always mean there is cause for concern. Remember that as reads and writes occur, pages are taken from the free list and eventually the amount of free memory will fall below lotsfree. In this case, the pageout scanner will be invoked to free up memory, hence a non-zero scan rate.
- ovigia: DAG: Dstat: Versatile resource statistics tool (dag.wieers.com)
- Unexpected Linux memory migration (blogs.cisco.com)
- The new operator in C++ (i-programmer.info)
- Where Did I Put That? Unexpected Linux Memory Migration (insidehpc.com)