Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 1998 14:09:15 -0700 (PDT)
From:      Doug White <dwhite@gdi.uoregon.edu>
To:        "Ronald F. Guilmette" <rfg@monkeys.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: How do I find out how much memory the kernel is using now? 
Message-ID:  <Pine.BSF.3.96.980527140049.2179L-100000@gdi.uoregon.edu>
In-Reply-To: <29194.896243382@monkeys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 26 May 1998, Ronald F. Guilmette wrote:

> >Run top and watch what turns to <brackets>.  <bracketed> processes are
> >swapped out.  Perhaps your huge process is leaking memory?
> 
> If it was leaking memory, then that fact would show up (glaringly) on a
> `ps -l' report would it not?

Maybe.

> >> number??  Is that really saying that I only have 3.8 MB left for user-level
> >> processes??
> >
> >That isn't bad.
> 
> Ah... excuse??  Come again?
> 
> I spent good money to put 32 MB of main memory in this puppy and now when
> I say that it look like the OS is using up all but 3.8 MB of that you say
> ``That isn't bad''.

FreeBSD (and UNIces in general) don't use memory the same way MicroSlop
systems do.  FreeBSD will allocate all of system RAM to itself, or as
much as it can use.  RAM is first allocated to the kernel then to user
programs.  Everything left over is allocted to a disk cache, aka buffer
cache, that is dynamically sized according to system RAM demands.  Thus
your `Free RAM' number will stay small.  Here's a snapshot of my
workstation's memory usage from top:

Mem: 15M Active, 1444K Inact, 15M Wired, 5016K Cache, 4536K Buf, 504K Free

This machine has 40MB of RAM installed.  I see the 500K left totally Free
is reserved for any instant memory demands, but otherwise the left over
9MB is allocated to the disk cache and buffers.

> P.S.  I am still hoping for an answer to my original question... How can
> I tell exactly how much memory the OS itself is using at any given
> instant in time? 

Define `OS itself'.  You mean the kernel only, kernel+devices, ... ?  Top
tends to give you the best measure but you have to interpret it right.

You should be paying attention to swap.  My swap line from top:

Swap: 100M Total, 41M Used, 59M Free, 41% Inuse

tells me that I shold have added some more swap when I brought my 2gig
drive online.  I've seen this up to 60% and that makes me really jumpy.

Doug White                              | University of Oregon  
Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
http://gladstone.uoregon.edu/~dwhite    | Computer Science Major



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980527140049.2179L-100000>