Adding up kernel mem usage

grarpamp grarpamp at gmail.com
Thu Oct 15 07:17:34 UTC 2009


If I subtract vmstat and kldstat from wired, I'm
missing approx 100M. What am I doing wrong
or what should I be adding up to find the total
mem in use by the kernel and a breakdown of
that usage? Thanks.

top -SH -d 1 1000 | egrep '^Mem:'
Mem: 114M Active, 65M Inact, 258M Wired, 468K Cache, 46M Buf, 551M Free

vmstat -m | sed -E 's,^(.............),,' | awk '{print $2}' | sed
's,K,,' | egrep -v MemUse | add
143920

{ printf 'ibase=16\n' ; kldstat | tr '[:lower:]' '[:upper:]' | egrep
-v SIZE | awk '{print $4}' | tr '\n' '\+' | sed 's,+$,,' ; } | bc
13986028

vmstat
 procs      memory      page                    disks     faults         cpu
 r b w     avm    fre   flt  re  pi  po    fr  sr ad0 ad4   in   sy
cs us sy id
 1 0 0    461M   551M    68   0   0   0    88   0   0   0   26 1189
654  3  1 97


More information about the freebsd-questions mailing list