sudden jump in swap usage, how to tell what's using it

David Scheidt dscheidt at panix.com
Sat Mar 4 04:52:22 PST 2006


On Thu, Mar 02, 2006 at 09:02:15AM -0500, Chuck Swiger wrote:
> 
> Nathan Vidican wrote:
> > Typically, we sit between 0-10% of swap used... this morning I came in,
> > and output of top is showing 76% used; that's some 3Gigs+ more than usual.
> > 
> > System load is still sitting at 0.05, and no adverse effects seem to be
> > coming our way. No particular processes appear to be using abnormal
> > amounts of memory, and nothing seems 'off'... is there a way to
> > determine which process(es) have taken out (how much) swap space?
> 
> "top -o size" or "top -o res"...

The second character of the state column in ps will tell you if a
process is swapped out.  (If it's W. )  Remember, though, that once
pages are swapped out, they don't get moved back into core until
they're used, which may well be never.  So if the machine is no longer 
under memory pressure, there may be nothing to tell you what used up the
memory.  It's very common to see long running machines have swap used,
even if in normal operation they have plenty of free memory.  An
one-time, or occaisonal, occurance of low memory will cause things to
get swapped.  Many processes have memory they use rarely, if ever;
idle processes also don't need to be swapped in until they become
non-idle.  

David


More information about the freebsd-questions mailing list