[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: what is using my swap



On Wednesday June 8 2005 2:07 pm, theal wrote:
> Does anyone know how to tell what program or PID is causing swap
> usage? I have a system with 2 GB RAM so it should using little or
> no swap, but at times it does and I need to determine what the
> cause is.

Are you using RAM?  Has your machine been running under heavy stress 
or more than a few hours?  Then you're going to be using swap no 
matter how much RAM you have.

Short answer:  Nothing is wrong, let the kernel do it's job.

Long answer:  Linux is extremely aggressive when it comes to swapping, 
because you can copy not-used-right-*now*-but-still-in-core data to 
swap without slowing down the system.  This avoids having to slow the 
machine to a crawl to swap out when the system needs more RAM, 
barring sudden, extreme demand for core.  It only swaps stuff in if 
the data needed isn't already in core (this is where you will "feel" 
the machine swap the vast majority of the time).

-- 
Paul Johnson
Email and Instant Messenger (Jabber): baloo@ursine.ca
http://ursine.ca/~baloo/

Attachment: pgp5iDBliKhkZ.pgp
Description: PGP signature


Reply to: