Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 2009 02:55:42 -0400
From:      grarpamp <grarpamp@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Adding up kernel mem usage
Message-ID:  <d2e731a10910142355i4b71a4ebl908b87a8e5d40403@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d2e731a10910142355i4b71a4ebl908b87a8e5d40403>