Subject: vmstat reports unbelieveable "avm"
To: None <port-sparc@NetBSD.ORG>
From: Erik E. Fair <fair@clock.org>
List: port-sparc
Date: 05/29/1997 17:43:06
  5:18PM  up 2 days,  7:55, 13 users, load averages: 0.38, 0.38, 0.32

procs   memory     page                    disks         faults   cpu
 r b w   avm   fre  flt  re  pi  po  fr  sr f0 s0 s1 s3   in   sy  cs us sy id
 2 0 01617092 20100   13   1   0   0   0   0  0  0  2  0  227  103  15  3  3 94
 0 0 02970188 19412   44   4   1   0   0   0  0  0  3  0  230  135  20  6  4 90
 0 0 06906412 17884   35   3   0   0   0   0  0  0  2  0  241  136  24  3  5 92
 0 0 01611448 19000   60   2   2   0   0   0  0  0  9  0  292  188  40  8  7 85
 0 0 02446168 18864   25   2   1   0   0   0  0  0  3  0  280  161  31  3  5 92
 0 0 02972848 17644   78   8   2   0   0   0  0  0  5  3  300  228  53 19  9 72
 0 0 02710004 18640   70   6   1   0   0   0  0  0  3  0  257  171  29  4  7 90
 1 0 02949048 17704   25   2   0   0   0   0  0  0  3  0  329  239  55  7  8 85

These numbers are from "vmstat 300" on cesium.clock.org, a 96M SPARC LX,
running NetBSD-current from Apr 30th. My other systems running more current
stuff also do this from time to time.

I have seen vmstat report avm of over 10GB (!!). All vmstat does to get
these numbers is a sysctl(2), grabbing info from "vmtotal", which appears
to be calculated on the fly at the time of the system call by walking the
MI VM data structures. As it is, you now see vmstat reporting nearly 3GB of
virtual memory in use, with little or no paging activity to speak of.

Since this is not vmstat grovelling through these VM structures itself
(that would be subject to errors induced by scheduling and context
switching delays, and the structures changing out from under vmstat while
was looking...) I am inclined to trust the numbers, kinda. It's just that
they're so absurd.

By contrast, summing up the VSZ and RSS columns from ps, and reporting
pstat -s gives the following:

vsz = 66960  rss = 18100
Device      1K-blocks     Used    Avail Capacity  Type
/dev/sd1b      109200        4   109196     0%    Interleaved
/dev/sd3b      109200        4   109196     0%    Interleaved
Total          218400        8   218392     0%

What's going on here?

	puzzled,

	Erik Fair <fair@clock.org>