Wired memory analysis

Matthew Dillon dillon at backplane.com
Thu Jan 17 11:18:54 PST 2019

Hmm.  That's definitely high for a system with 8G of ram.  Diagnosing this
is a bit messy.

The first thing to do is to look at the buffer cache space used in systat
-vm 1.  It's the 'buf' element.  on an 8GB machine it should be lower than
1.5 GB.

The next thing you can do is look at the summary memory total at the end of
the 'vmstat -m' output.  However, that number does not accurately convey
kernel memory use because it doesn't include the kernel's caching of free

After that you can compile the kmapinfo debug utility:

cd /usr/src/test/debug
make kmapinfo

And then run it as '/tmp/kmapinfo'.   This is for low level debugging and
interpreting the output is not easy because many of the memory zones
reported are virtual allocations and not physical allocations.  However,
you can determine the actual amount of memory allocated by the kernel by
observing the 'KMALLOC' line in the summary at the end.

There are a few other elements at the end of the kmapinfo output that are
useful.  PVENTRY and PML4 are useful.  Note that SYSMAP and ZALLOC are not
because those are mostly virtual reservations.

See how all of that adds up for you.   Buffer cache memory from the systat
-vm 1, then KMALLOC + PVENTRY + PML4 from kmapinfo.  If some of those are
blown out beyond reason it will give me a place to start looking.


On Thu, Jan 17, 2019 at 4:22 AM Daniel Bilik <ddb at neosystem.org> wrote:

> Hi.
> After recent update (from to my system
> regularly runs out of swap space during daily periodic(8) (which is
> shifted to 1pm as the system doesn't run 24/7). Sometimes the system runs
> out of memory and kills processes, most often chrome, but X also got hit
> at least one time.
> When inspecting the system during this unpleasant situation, I've noticed
> quite high numbers under "wired memory" in top(1). It's a little above
> 1000M when the system boots and desktop is launched, it gets to around
> 3500M after cca 5 hours of "normal" desktop usage, but I've seen more then
> 6000M after periodic(8). What's remarkable, when "wired" gets that high, it
> doesn't drop significantly even after periodic(8) is done.
> The system has 8G of memory, and it hasn't been utilizing it's 512M of swap
> such heavily before the mentioned update. In fact, it's been barely
> touching
> the swap.
> Is there a way one can inspect the content of "wired memory" (and
> potentially identify most hungry consumer)? (I know it's _wired_ but) is
> there a way a system can be forced to release some of this memory?
> Thank you.
> --
>                                                 Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20190117/a7cb7ed3/attachment-0003.htm>

More information about the Users mailing list