Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Nov 2010 22:06:08 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: Memory leak and swapfile
Message-ID:  <4CF180D0.7080004@infracaninophile.co.uk>
In-Reply-To: <E498FF36B7674C90BEF8E82AA85F82DE@jarasc430>
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> <E498FF36B7674C90BEF8E82AA85F82DE@jarasc430>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CF180D0.7080004>