Subject: Re: mem stats
To: Nathan Gelbard <>
From: Jason Thorpe <>
List: port-hp300
Date: 03/10/1997 00:43:16
On Mon, 10 Mar 1997 00:30:56 -0800 
 Nathan Gelbard <gelbard@ENGR.ORST.EDU> wrote:

 > Under Linux, I can type 'free' and see all the stats on what
 > memory is available, swap, etc. What is the command under
 > NetBSD? 

You'll want to read the manual pages for "vmstat" and "pstat".

"vmstat -m" will print kernel memory statistics.  If you see:

lestat (thorpej) ~ 113% vmstat -m
Kmem statistics are not being gathered by the kernel.

...then you need to rebuild your kernel with:

options		KMEMSTATS		# gather kernel memory statistics

Note, with KMEMSTATS _not_ enabled, performance is notably better in
certain critical paths, due to shortcuts the kernel MALLOC() implementation
can perform.

 > How can I tell if swap is actually being used? Under Linux,
 > swap gets 'turned on' durring the boot process. I've got a 
 > swap parition (b), dont know if its acutally being used.

"pstat -s" shows swap usage.  The primary swap partition (root device,
partition b) is automatically enabled by the kernel.

basalt (thorpej) ~ 145% pstat -s
Device      1024-blocks     Used    Avail Capacity  Type
/dev/sd0b         99744    50708    49036    51%    Interleaved
basalt (thorpej) ~ 146% 

As you can see, while I'm running X, a few instances of emacs, and
compiling the NetBSD source tree, I use a bit of swap on my 32M hp380 :-)


Jason R. Thorpe                             
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939