memory leak and swapfile

Ian Smith smithi at nimnet.asn.au
Sat Nov 27 14:13:47 UTC 2010


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 at jarasoft.net>
 > > > Date: Fri, 26 Nov 2010 19:17:05 +0100
 > > > Sender: owner-freebsd-stable at 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


More information about the freebsd-stable mailing list