From owner-freebsd-stable@FreeBSD.ORG Thu Aug 21 22:52:10 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B4F81065676 for ; Thu, 21 Aug 2008 22:52:10 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 2BF5B8FC18 for ; Thu, 21 Aug 2008 22:52:10 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 19B101CC0C0; Thu, 21 Aug 2008 15:52:10 -0700 (PDT) Date: Thu, 21 Aug 2008 15:52:10 -0700 From: Jeremy Chadwick To: freebsd-stable@freebsd.org Message-ID: <20080821225210.GA30726@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: Memory Usage Stats X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 22:52:10 -0000 ----- Forwarded message from Sabeeh Baig ----- > From: Sabeeh Baig > To: Jeremy Chadwick > Date: Thu, 21 Aug 2008 16:51:13 -0400 > Subject: Re: Memory Usage Stats > > 1) I didn't know that about swap allocation. > > 2) I know what each of the categories of memory stand for and what > role they play and how they are used, so no I don't think of free > memory like that. Actually, total free memory includes inactive as > well, since inactive keeps inactive pages for future use to improve > performance, but dynamically reallocates them if necessary. > > 3) I followed standard update procedure listed in the handbook. I > don't deviate from that, as I don't want a broken mess to deal with. > > ------------------------------------------------------------------------------ > > 1) I run AMD64. > > 2) How would I get this information, as I rebuilt it over a week ago. > > 3) I will provide this information once I get home. > > On Thu, Aug 21, 2008 at 4:16 PM, Jeremy Chadwick wrote: > > On Thu, Aug 21, 2008 at 02:05:50PM -0400, Sabeeh Baig wrote: > >> I've been noticing never-before-seen highs in memory usage, since the > >> last time I rebuilt world a bout a week ago. I have 2GB of memory and > >> 2GB of swap space. According to top, a little over 1GB of memory is > >> active, 70MB free, 300MB wired, and the rest inactive. I also have > >> 59MB of swap used. > > > > The swap in use is fine; memory which is often untouched (e.g. allocated > > but then not utilised for some time) is often swapped out to disk. > > > >> If I close an application, the amount of active memory never decreases > >> and the other stats don't change either. > > > > I think you may be reading top output incorrectly, which is a common > > problem these days. I hope you're not assuming that the "Free" column > > in top defines how much memory there is available for allocation on the > > system. > > > >> The active figure can't be right even now, as I only have > >> Xfce, Xorg, screen, two zsh session, slurm, irssi, pidgin, mpd, ncmpc, > >> and irssi running. That's usually my normal session and usage has > >> been better before I recompiled. > > > >> Is it possible that top is displaying the wrong stats? > > > > Possibly -- how exactly did you rebuild your system when you said you > > "rebuilt world"? Did you follow each and every step in src/Makefile, > > including booting into single user, etc. etc.? > > > > The reason I mention this is, lots of userland utilities rely on libkvm. > > For example, you rebuilt your kernel (and the KVM structure within the > > kernel changed due to CVS commits or whatever else), but you didn't > > rebuild userland (e.g. libkvm still refers to the old KVM structure), > > then you will see very odd numbers or possibly total breakage in top, > > ps, systat, etc... > > > >> Is there any other utility I could try? > > > > systat, vmstat, and procstat (the latter only available if you're using > > a fairly recent RELENG_7 or HEAD; and it may not be of much help here, > > since it just provides a break-down of memory usage within a process) > > > >> I've tried ps auxm, but that's not exactly what I'm looking for. > > > > You could start by: > > > > 1) Stating if you're on i386 or amd64 -- it matters, > > 2) Providing top output (sorted by "res") before and after said > > rebuild, > > 3) Providing top output (sorted by "res") before and after you > > terminate a process that uses a large amount of memory. > > > > -- > > | Jeremy Chadwick jdc at parodius.com | > > | Parodius Networking http://www.parodius.com/ | > > | UNIX Systems Administrator Mountain View, CA, USA | > > | Making life hard for others since 1977. PGP: 4BD6C0CB | > > > > > > > > -- > "UNIX is basically a simple operating system, but you have to be a > genius to understand the simplicity." > > Sabeeh Ahmed Baig > ----- End forwarded message ----- OP forgot to CC the mailing list. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |