From owner-freebsd-questions Wed May 27 14:10:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA01514 for freebsd-questions-outgoing; Wed, 27 May 1998 14:10:59 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA01453 for ; Wed, 27 May 1998 14:10:35 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.8/8.8.8) with SMTP id OAA02275; Wed, 27 May 1998 14:09:15 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Date: Wed, 27 May 1998 14:09:15 -0700 (PDT) From: Doug White Reply-To: Doug White To: "Ronald F. Guilmette" cc: questions@FreeBSD.ORG Subject: Re: How do I find out how much memory the kernel is using now? In-Reply-To: <29194.896243382@monkeys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 26 May 1998, Ronald F. Guilmette wrote: > >Run top and watch what turns to . 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