From owner-freebsd-questions@FreeBSD.ORG Tue Dec 30 20:23:26 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F70B106566C for ; Tue, 30 Dec 2008 20:23:26 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 226098FC1D for ; Tue, 30 Dec 2008 20:23:25 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id mBUKH2bt037003; Tue, 30 Dec 2008 15:17:02 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id mBUKH2gM037002; Tue, 30 Dec 2008 15:17:02 -0500 (EST) (envelope-from jerrymc) Date: Tue, 30 Dec 2008 15:17:01 -0500 From: Jerry McAllister To: FreeBSD Message-ID: <20081230201701.GD36749@gizmo.acns.msu.edu> References: <494A693A.5050204@optiksecurite.com> <200812181028.18306.kirk@strauser.com> <20081218163632.GE5150@torus.slightlystrange.org> <494A820E.2030907@optiksecurite.com> <20081219040719.GA83557@gizmo.acns.msu.edu> <494BBFCA.5060305@optiksecurite.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <494BBFCA.5060305@optiksecurite.com> User-Agent: Mutt/1.4.2.2i Cc: Jerry McAllister , freebsd-questions@freebsd.org Subject: Re: SOLVED: Simple swap question 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: Tue, 30 Dec 2008 20:23:26 -0000 On Fri, Dec 19, 2008 at 10:37:46AM -0500, FreeBSD wrote: > Jerry McAllister a écrit : > >On Thu, Dec 18, 2008 at 12:02:06PM -0500, FreeBSD wrote: > > > > > >>Daniel Bye a écrit : > >> > >>>On Thu, Dec 18, 2008 at 10:28:18AM -0600, Kirk Strauser wrote: > >>> > >>>>On Thursday 18 December 2008 09:16:10 FreeBSD wrote: > >>>> > >>>>>Hi everyone, > >>>>> > >>>>>I have a FreeBSD 7.0-Release server that started to swap after an error > >>>>>in a shell script (process spawning competition ;-) ). I killed the > >>>>>shell and the RAM is now OK. The problem is that the swap is still > >>>>>used. > >>>>>How can I "reset" the swap? > >>>>> > >>>>You don't. The system will handle it for you, I promise. :-) > >>>> > >>>And very well, too. > >>> > >>>You can prompt it to move pages back into RAM if you start using a > >>>swapped- > >>>out process again - say, for example, a quiescent word processor had been > >>>swapped out, you could get it back by raising it and starting to type. > >>> > >>>But as Kirk said, there really is no need. It's one of the kernel's many > >>>jobs, and I'm inclined to leave it get on with it! > >>> > >>>Dan > >>> > >>> > >>Thanks for your answer. I'm asking here because it's been several days > >>and there is still used swap for data that should never be used anymore. > >>If the kernel wants to keep it, why not move it to RAM now that there is > >>some free? > >> > > > >Why bother if it isn't being currently used? > > > >////jerry > > > > > Because this server is monitored by Nagios and it emails me every hour a > warning because the swap is not 100% free (I know it's pretty extreme, > but I want to know if the system is swapping). > > I just tried > > swapoff -a ; swapon -a > > and it worked great. > > Thanks everyone for your answer. > > Martin > But, you want it to use swap. The system uses swap to stash stuff it is not currently using - where it can move it back in to use in a much more efficient, fast manner than re-looking it up again on filesystem disk. ////jerry > >