From owner-freebsd-questions@FreeBSD.ORG Thu Dec 18 20:11:46 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 A0A381065674 for ; Thu, 18 Dec 2008 20:11:46 +0000 (UTC) (envelope-from freebsd@optiksecurite.com) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5248FC12 for ; Thu, 18 Dec 2008 20:11:46 +0000 (UTC) (envelope-from freebsd@optiksecurite.com) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from [69.69.69.183] ([69.70.93.206]) by VL-MO-MR005.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 32bit)) with ESMTP id <0KC300ECL9E720C0@VL-MO-MR005.ip.videotron.ca> for freebsd-questions@freebsd.org; Thu, 18 Dec 2008 15:10:55 -0500 (EST) Message-id: <494AAED8.2020809@optiksecurite.com> Date: Thu, 18 Dec 2008 15:13:12 -0500 From: FreeBSD User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) To: freebsd-questions@freebsd.org References: <494A693A.5050204@optiksecurite.com> <200812181028.18306.kirk@strauser.com> <20081218163632.GE5150@torus.slightlystrange.org> <494A820E.2030907@optiksecurite.com> <20081218171135.GF5150@torus.slightlystrange.org> In-reply-to: <20081218171135.GF5150@torus.slightlystrange.org> Subject: Re: 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: Thu, 18 Dec 2008 20:11:46 -0000 Daniel Bye 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? > > Because it has swapped out an entire process, which hasn't subsequently > been woken up again. It's you that says the data are never going to be > needed again - the kernel doesn't know that, so keeps the pages there in > swap until you either reawaken the process, or kill it, at which point > the swap space they occupied will be freed up. > > You can see which processes are swapped out in top - the process name is > in parentheses. If it is irking you sufficiently, you can kill the > processes and reclaim your swap ;-) > > Dan > I can't see any process within parentheses in top... I also looked at the -f option of ps but the process that caused the swapping are not listed. Thanks for helping me clarify this. Martin