SUMMARY: quick swap question -- which processes are swapped?

From: Adam and Christine Levin <levins_at_westnet.com>
Date: Tue Feb 10 2004 - 10:16:26 EST
Thanks to the following vacationers, whom I hope are having more fun than
me:
"Patni, Sandeep" <Sandeep.Patni@gs.com>
Gustavo Tobares <gtobares@redmegatone.com>
"Sharma, Pankaj" <psharma@panynj.gov>
"Ayed, Mohamed [IT]" <mohamed.ayed@citigroup.com>

Thanks for their help to:
Lance Tost <lance.tost@respironics.com>
Darren Dunham <ddunham@taos.com>
Anthony Talltree <aad@verio.net> RSS=0?
Rich Kulawiec <rsk@gsp.org>

Some suggestions were:

Check for processes with RSS=0.  That didn't get me what I needed, though.

User fuser -u /path/to/swapdev came up empty.

The most complete answer came from Rich:

On Mon, Feb 09, 2004 at 12:02:42PM -0500, Adam and Christine Levin wrote:
> I'm wondering if there's a way to know which processes those five are?
> Is there something in ps output that'll tell me which processes are
> currently living in swap?

"top" is probably handier than ps, though you can extract this information
with that, too.

What you're looking for are processes that are (a) asleep (b) have a RES
that's not a large percentage of their SIZE.

Example (from top output):

   185 root       1  59    0 2204K  948K sleep    0:00  0.00% cron

Cron is currently sleeping.  It has PID 185.   The process SIZE is actually
2204K, but the RESident size is only 948K, which means 2204-948 = 1256K are
either paged out (or never paged in, but let's ignore that).

Thing is, that the virtual memory subsystem has its own ideas about what
should be paged out, how much should be paged out, and when, so even if
you have a big process (say 50M) and it's been idle for a week, it's not
necessarily true that it will all be paged out.

To put it another way: many processes have chunks in physical memory
and paged out to swap, *including running ones*.  (After all, if execution
in a 50M process is local to a 5M chunk, why should some other random
5M chunk of it get paged in?)  So "swapped out" doesn't mean what it
did in the Unix world many years ago, when it meant "entire process
copied to the swap area and deleted from physical memory".  Today,
it's more-or-less a synonym for "some chunks of the process have been
copied to the swap area and deleted from physical memory".

---Rsk

Anyway, thanks, all.  Basically, I've settled on the answer that since the
machine isn't actively paging, and there's plenty of memory left over,
it's nothing to worry about, even though the graphs *look* nasty.

Original question follows:

> I have what I hope is a simple question.
>
> I'm using the SE Toolkit and Orca to graph system metrics.  One thing I
> see is that currently, my runq graphs listing processes running, waiting
> for I/O and swapped says that 5 processes are swapped, and have been for
> weeks.
>
> These systems have been up a long time, and there's no serious page scans
> going on.  The machines aren't hurting for memory, and in fact neither
> the physical nor the swap are near full.
>
> I'm wondering if there's a way to know which processes those five are?
> Is there something in ps output that'll tell me which processes are
> currently living in swap?
>
> This is on a Solaris 8 system, E450.
>
> Thanks,
> -Adam
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Feb 10 10:16:05 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:28 EST