Re: Freebsd 14.3 wired memory custom or generic kernel

From: Eugene Grosbein <eugen_at_grosbein.net>
Date: Sun, 07 Sep 2025 23:07:17 UTC
08.09.2025 5:21, kunn wrote:

> command: "vmstat -z | sed 's/:/,/' | awk -F, '{printf "%10s %s\n", $2*$4/1024/1024, $1}' | sort -k1,1 -rn | head"
> output:
> 23.2852 vm pgcache
> 18.9492 vm pgcache
> 9.91821e-05 fakepg
> 6.10352e-05 pcpu-16
> 3.05176e-05 udp_inpcb ports
> 2.20312 kstack_cache
> 1.98438 mbuf_cluster
> 1.82812 malloc-4096
> 1 mbuf_jumbo_page
> 0.907349 malloc-128

Well, it explains most part of wired memory usage, in megabytes.
First two lines show 42.2MB of virtual memory page cache in total.

kstack_cache + mbuf_cluster + malloc* + mbuf_jumbo_page
sum to about 8MB extra wired memory to about 60MB including above 42.2MB.

Add to this a number shown with "kldstat -h" multipled by two,
that's amount of wired memory reserved at boot time for kernel code itself and its
internal working set needed to start the rest of the system and thereafter.

Some more kernel dynamic memory allocated using malloc(9) is shown with "vmstat -m".