From owner-freebsd-questions@FreeBSD.ORG Thu Dec 18 17:11:49 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 4A7C71065670 for ; Thu, 18 Dec 2008 17:11:49 +0000 (UTC) (envelope-from danielby@slightlystrange.org) Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by mx1.freebsd.org (Postfix) with ESMTP id A2CCD8FC17 for ; Thu, 18 Dec 2008 17:11:43 +0000 (UTC) (envelope-from danielby@slightlystrange.org) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20081218171142.VITK2989.mtaout01-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Thu, 18 Dec 2008 17:11:42 +0000 Received: from catflap.slightlystrange.org ([82.21.101.171]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20081218171142.NELR22934.aamtaout04-winn.ispmail.ntl.com@catflap.slightlystrange.org> for ; Thu, 18 Dec 2008 17:11:42 +0000 Received: by catflap.slightlystrange.org (Postfix, from userid 106) id D94786133; Thu, 18 Dec 2008 17:11:36 +0000 (GMT) Received: from torus.slightlystrange.org (torus.slightlystrange.org [10.1.3.50]) by catflap.slightlystrange.org (Postfix) with SMTP id 608F56131 for ; Thu, 18 Dec 2008 17:11:36 +0000 (GMT) Received: by torus.slightlystrange.org (sSMTP sendmail emulation); Thu, 18 Dec 2008 17:11:36 +0000 From: "Daniel Bye" Date: Thu, 18 Dec 2008 17:11:36 +0000 To: freebsd-questions@freebsd.org Message-ID: <20081218171135.GF5150@torus.slightlystrange.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <494A693A.5050204@optiksecurite.com> <200812181028.18306.kirk@strauser.com> <20081218163632.GE5150@torus.slightlystrange.org> <494A820E.2030907@optiksecurite.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xjyYRNSh/RebjC6o" Content-Disposition: inline In-Reply-To: <494A820E.2030907@optiksecurite.com> User-Agent: Mutt/1.4.2.3i X-PGP-Fingerprint: D349 B109 0EB8 2554 4D75 B79A 8B17 F97C 1622 166A X-Operating-System: FreeBSD 7.1-PRERELEASE i386 X-Cloudmark-Analysis: v=1.0 c=1 a=ehNlctqhnw0A:10 a=R6AqpJysuz3qlS3-tJkA:9 a=tptwTyd1s9tOIFRUTOCv9NSj4h0A:4 a=LY0hPdMaydYA:10 a=_Mw4DAAZoly9ukkUB2QA:9 a=QgKu5xhfXhh6LLoa-0BXFmOqpS8A:4 a=rPt6xJ-oxjAA:10 Subject: Re: Simple swap question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2008 17:11:49 -0000 --xjyYRNSh/RebjC6o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 use= d. > >>>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 swapp= ed- > >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 > > >=20 > Thanks for your answer. I'm asking here because it's been several days=20 > and there is still used swap for data that should never be used anymore.= =20 > If the kernel wants to keep it, why not move it to RAM now that there is= =20 > 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 --=20 Daniel Bye _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --xjyYRNSh/RebjC6o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAklKhEcACgkQixf5fBYiFmo/EwCgkL1UgFEjKB1buW10StZ9GAhe pJUAn3uRaaxVc7U7SnDOEQaMtXDewMjC =ts1j -----END PGP SIGNATURE----- --xjyYRNSh/RebjC6o--