Kernel memory usage

Ryan Stone rysto32 at gmail.com
Wed Oct 10 16:42:47 UTC 2012


On Mon, Oct 8, 2012 at 9:26 PM, Sushanth Rai <sushanth_rai at yahoo.com> wrote:
> I was trying to co-relate the o/p from "top" to that I get from vmstat -z. I don't have any user programs that wires memory. Given that, I'm assuming the wired memory count shown by "top" is memory used by kernel. Now I would like find out how the kernel is using this "wired" memory. So, I look at dynamic memory allocated by kernel using "vmstat -z". I think memory allocated via malloc() is serviced by zones if the allocation size is <4k. So, I'm not sure how useful "vmstat -m" is. I also add up memory used by buffer cache. Is there any other significant chunk I'm missing ? Does vmstat -m show memory that is not accounted for in vmstat -z.

All allocations by malloc that are larger than a single page are
served by uma_large_malloc, and as far as I can tell these allocations
will not be accounted for in vmstat -z (they will, of course, be
accounted for in vmstat -m).  Similarly, all allocations through
contigmalloc will not be accounted for in vmstat -z.


More information about the freebsd-hackers mailing list