Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 2010 01:13:37 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Jeremy Chadwick <freebsd@jdc.parodius.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: memory leak and swapfile
Message-ID:  <20101128001107.L47536@sola.nimnet.asn.au>
In-Reply-To: <20101127121743.GA97603@icarus.home.lan>
References:  <1DDFC51B19BA4655A2B8AFE4EC536337@jarasc430> <20101127031259.7CD631CC0C@ptavv.es.net> <20101127121743.GA97603@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 27 Nov 2010, Jeremy Chadwick wrote:
 > On Fri, Nov 26, 2010 at 07:12:59PM -0800, Kevin Oberman wrote:
 > > > From: "Jack Raats" <jack@jarasoft.net>
 > > > Date: Fri, 26 Nov 2010 19:17:05 +0100
 > > > Sender: owner-freebsd-stable@freebsd.org
 > > > 
 > > > 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.
 > > > 
 > > > Any suggestions?
 > > 
 > > ps -aux Look for processes with large values in the VSZ column. 
 > > 
 > > I'm sure that there are other ways to see this, but that's an easy
 > > one. You can, of course, pipe the output to sort and use the -k 5 -n
 > > options. 
 > 
 > I believe he should be looking for a process that has a large value in
 > RSS ("RES" in top), not VSZ ("SIZE" in top).

Not necessarily.  More noticeable in physical-memory constrained systems 
(try 160MB!), processes that leak memory badly (say mozilla) push leaked 
but quiescent memory out to swap, where it lurks forever, growing with 
every page of eg crappy javascript, while RSS stays more constrained.

% ps aux | sort -rnk5 | head -2
smithi 11451  0.0 27.3 119008 42276  ??  S    11Nov10 336:47.74 /usr/local/lib/mozilla/mozilla-bin
root   45236  1.9  7.8  45328 12132  v7  R    15Aug10 3261:37.36 X :0 -auth /home/smithi/.serverau

At least 35MB of moz's VSZ is leaked and will disappear once restarted, 
plus another 15MB or so of VSZ X is hanging onto on mozilla's account.

Small system, small example; big-iron folks miss out on half the fun :)

cheers, Ian



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