From owner-freebsd-questions@FreeBSD.ORG Sat Mar 4 12:52:22 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74DE516A420 for ; Sat, 4 Mar 2006 12:52:22 +0000 (GMT) (envelope-from dscheidt@panix.com) Received: from mail1.panix.com (mail1.panix.com [166.84.1.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0370343D45 for ; Sat, 4 Mar 2006 12:52:21 +0000 (GMT) (envelope-from dscheidt@panix.com) Received: from panix1.panix.com (panix1.panix.com [166.84.1.1]) by mail1.panix.com (Postfix) with ESMTP id 2313C599AD; Sat, 4 Mar 2006 07:52:21 -0500 (EST) Received: (from dscheidt@localhost) by panix1.panix.com (8.11.6p3/8.8.8/PanixN1.1) id k24CqL406861; Sat, 4 Mar 2006 07:52:21 -0500 (EST) Date: Sat, 4 Mar 2006 07:52:21 -0500 From: David Scheidt To: Chuck Swiger Message-ID: <20060304125221.GA4213@panix.com> References: <4406F241.1030504@wmptl.com> <4406FAE7.6010000@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4406FAE7.6010000@mac.com> User-Agent: Mutt/1.5.10i Cc: questions@freebsd.org, Nathan Vidican Subject: Re: sudden jump in swap usage, how to tell what's using it X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Mar 2006 12:52:22 -0000 On Thu, Mar 02, 2006 at 09:02:15AM -0500, Chuck Swiger wrote: > > Nathan Vidican wrote: > > Typically, we sit between 0-10% of swap used... this morning I came in, > > and output of top is showing 76% used; that's some 3Gigs+ more than usual. > > > > System load is still sitting at 0.05, and no adverse effects seem to be > > coming our way. No particular processes appear to be using abnormal > > amounts of memory, and nothing seems 'off'... is there a way to > > determine which process(es) have taken out (how much) swap space? > > "top -o size" or "top -o res"... The second character of the state column in ps will tell you if a process is swapped out. (If it's W. ) Remember, though, that once pages are swapped out, they don't get moved back into core until they're used, which may well be never. So if the machine is no longer under memory pressure, there may be nothing to tell you what used up the memory. It's very common to see long running machines have swap used, even if in normal operation they have plenty of free memory. An one-time, or occaisonal, occurance of low memory will cause things to get swapped. Many processes have memory they use rarely, if ever; idle processes also don't need to be swapped in until they become non-idle. David