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

next in thread | previous in thread | raw e-mail | index | archive | help

In message <Pine.BSF.3.96.980527140049.2179L-100000@gdi.uoregon.edu>, you wrote
:

>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.

Yes, i knew all that.  I was discounting the disk buffer cache.  When
`stsctl -a' told me I only had about 3.8 MB of ``user memory'' that still
didn't sound at all correct.  (But maybe it was... see below.)

>> 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, ... ?

Yup.

>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.

OK.  Thanks.  Now I'm getting somewhere.  This is the kind of guidance I
was looking for.  (I dunno why I didn't think to run top earlier.  Duh.)

The results from top on my system are interesting and rather misleading.
Due to some goofy partitioning left over from another project, I have a
HUGE 1.5 GB swap partition.  Top shows that (on average) I am only using
about 1% of that, which superficially sounds quite modest and OK, until
I looked more closely and saw that the truth of that matter is that I'm
constantly using about 18 MB of swap... mostly due to a single big process
that I know is thrashing its actual working set a lot.

So at last I have my answer.  I need to put at least 18 MB more main memory
into this machine in order to get it to stop behaving like a whashing machine
with a unbalanced load set to the `spin' cycle. :-)  I'll be doing that
forthwith.

Thanks for the help!


-- Ron Guilmette, Roseville, California ---------- E-Scrub Technologies, Inc.
-- Deadbolt(tm) Personal E-Mail Filter demo: http://www.e-scrub.com/deadbolt/
-- Wpoison (web harvester poisoning) - demo: http://www.e-scrub.com/wpoison/

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?27896.896308262>