Subject: Re: Find out memory usage per process in ddb
To: Tomas Sk?re <tomas@nocrew.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 02/03/2004 16:39:45
hi,

"ps/a" will show you the vm_map pointer for each process,
then "show map/f" on the vm_map address will show you the
pmap resident count.  that's as close to a real number as
you're going to get.  even that isn't necessarily very meaningful,
since it counts some things twice and others not at all.

the sum of active + inactive + wired + free being less than the total
means that the kernel is using the rest of the pages for some internal
purpose, but there's no way of knowing what without some investigation.
most likely it means that there's some bug where the kernel is losing
track of pages.

I don't remember if there was anything fixed between 1.6 and 1.6.2
related to this, but you might try a kernel from the latest 1.6.2 RC anyway.

-Chuck


On Mon, Feb 02, 2004 at 01:35:48PM +0100, Tomas Sk?re wrote:
> Hi,
> 
> I'm running netbsd 1.6 on a PPC machine which has 64MB ram but no
> swap. Sometimes, the machine panics in pagedaemon, most likely due to
> lack of memory. I get to ddb, but I can't find any way there to see
> how much memory each process takes? I've had a look at "show all
> procs/a" and "show map/f ...", but I don't understand the output.
> 
> output from show uvmexp:
> 
> Current UVM status:
>   pagesize=4096 (0x1000), pagemask=0xfff, pageshift=12
>   13991 VM pages: 2225 active, 1116 inactive, 100 wired, 67 free
>   min  10% (25) anon, 10% (25) file, 5% (12) exec
>   max  80% (204) anon, 50% (128) file, 30% (76) exec
>   pages  987 anon, 1625 file, 961 exec
>   freemin=64, free-target=85, inactive-target=1115, wired-max=4663
>   faults=684992, traps=9668328, intrs=8696855, ctxswitch=18686643
>   softint=1721630, syscalls=7667380, swapins=0, swapouts=0
>   fault counts:
>     noram=0, noanon=0, pgwait=0, pgrele=0
>     ok relocks(total)=2321(2321), anget(retrys)=562917(0),
>   amapcopy=5439
>     neighbor anon/obj pg=9174/75623, gets(lock/unlock)=29806/2323
>     cases: anon=558288, anoncow=4629, obj=19842, prcopy=9962, przero=89832
>   daemon and swap counts:
>     woke=63, revs=63, scans=29889, obscans=11064, anscans=361
>     busy=0, freed=0, reactivate=13689, deactivate=31076
>     pageouts=0, pending=0, nswget=0
>     nswapdev=0, nanon=13103, nanonneeded=13103 nfreeanon=12348
>     swpages=0, swpginuse=0, swpgonly=0 paging=0
> 
> Something I don't understand about this output is the number of VM
> pages. Total is far more than the sum of active, inactive, wired and
> free. What is the rest?
> 
> 
> Greetings,
> 
> Tomas