From owner-freebsd-questions@FreeBSD.ORG Sat Nov 27 22:06:21 2010 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 004C31065670 for ; Sat, 27 Nov 2010 22:06:20 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3fd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 51E498FC0C for ; Sat, 27 Nov 2010 22:06:20 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id oARM6GJH071888 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Sat, 27 Nov 2010 22:06:16 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk oARM6GJH071888 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1290895576; bh=Rtxga/e5YiVlBWURDxGUxzyPaRqUM1L2zGgjObf+S/Q=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4CF180D0.7080004@infracaninophile.co.uk>|Date:=20S at,=2027=20Nov=202010=2022:06:08=20+0000|From:=20Matthew=20Seaman= 20|User-Agent:=20Mozilla/5.0=20(M acintosh=3B=20U=3B=20Intel=20Mac=20OS=20X=2010.6=3B=20en-US=3B=20r v:1.9.2.12)=20Gecko/20101027=20Thunderbird/3.1.6|MIME-Version:=201 .0|To:=20freebsd-questions@freebsd.org|Subject:=20Re:=20Memory=20l eak=20and=20swapfile|References:=20<4CED8855.23373.40E2965D@dave.g 8kbv.demon.co.uk>,=09<4CEEC055.15679.45A559A8@dave.g8kbv.demon.co. uk>,=09<20101125212508.82f1a646.freebsd@edvax.de>=09<4CEF9A55.2953 5.48F8EF07@dave.g8kbv.demon.co.uk>=20|In-Reply-To:=20|X-Enigmail-Version:=201.1.1|OpenPGP:=20id=3D60AE908C|Con tent-Type:=20multipart/signed=3B=20micalg=3Dpgp-sha1=3B=0D=0A=20pr otocol=3D"application/pgp-signature"=3B=0D=0A=20boundary=3D"------ ------enig5582D6BA1CCBBEAA1A595E9D"; b=uZr5DcquHu1D7t1hTR9jMI9YgCY5adFASh4xnuAj5t5b/BdstJWgVgso5r+IP4lMw PtYXk4eWB19KYX9KHYfc4ApCYj7Li6gpeqgyVFThbU/OIOZSIjvYcFXLGeRqGEw4YX eYmYob6ujfDwX0hSt9e5rfkP2wnTxs3eRPzPEPC8= Message-ID: <4CF180D0.7080004@infracaninophile.co.uk> Date: Sat, 27 Nov 2010 22:06:08 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4CED8855.23373.40E2965D@dave.g8kbv.demon.co.uk>, <4CEEC055.15679.45A559A8@dave.g8kbv.demon.co.uk>, <20101125212508.82f1a646.freebsd@edvax.de> <4CEF9A55.29535.48F8EF07@dave.g8kbv.demon.co.uk> In-Reply-To: X-Enigmail-Version: 1.1.1 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5582D6BA1CCBBEAA1A595E9D" X-Virus-Scanned: clamav-milter 0.96.4 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_FAIL autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lucid-nonsense.infracaninophile.co.uk Subject: Re: Memory leak and swapfile 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, 27 Nov 2010 22:06:21 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5582D6BA1CCBBEAA1A595E9D Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 26/11/2010 18:24, Jack Raats wrote: > It looks like that there may be a memory leak of my swap space with one= > of the processes that is running. > Big question: How can I determine which process is responsible. >=20 > Any suggestions? Look for a process with a really big SIZE in top(1) ? Look for pages being mapped to swap via 'systat -vmstat 1' Any activity of the Swap Pager is a bad sign. It's not so much 'swap space' as some process or processes using up memory in general: when more memory has been allocated by processes than will fit into RAM simultaneously, then you'll start getting pages mapped to swap. This is not intrinsically a bad thing: a one-time swap out of a load of otherwise idle memory pages will clear space for more actively used stuff. It's generally very bad for performance if processes are getting continually swapped in and out -- disk IO is pretty slow compared to RAM. Use eg. 'systat -vmstat 1' to monitor swap activity. It's not necessarily *one* process getting too big. Processes that fork multiple copies of themselves (like apache) can fill up RAM by spawning too many copies of themselves. In fact, it's a well known apache tuning trick to limit the maximum number of apache child processes to what will fit into RAM at one time -- swapping makes a far bigger impact on performance than queueing up web requests until there's a free worker process to service them. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@infracaninophile.co.uk Kent, CT11 9PW --------------enig5582D6BA1CCBBEAA1A595E9D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkzxgNgACgkQ8Mjk52CukIy9SQCfS4FWfOKoZiEn4u5ze2Ow62l6 ylkAn0FQPgL/KPoJNxKRXo5/omD74L3r =4XFP -----END PGP SIGNATURE----- --------------enig5582D6BA1CCBBEAA1A595E9D--