SUMMARY: Making Sense of Swap Space

Date: Tue Aug 22 2000 - 09:58:47 CDT

Thanx goes to

Casper Dik

Hans Schaechl

Richard Smith

Ric Anderson

for pointing out my obvious mistakes (blocks, not bytes) and giving additional
      useful info.

To Summarise:

vmstat provides averages over time and may give aproximations of current system
      status when run with "interval" parameters.

swap -l and swap -s together give current status

Watch vmstat "sr" (Scanrate) - if high numbers - eg over 200 then it is
      searching for additional ram.

iostat -xn 30 to report disk activity, or iostat -xtc for a slightly different

/usr/proc/bin/pmap -x pid give process resident memory size, but not swapped
      size. See man pmap for help on this and the other /proc tools.

Read Articles by Adrian and his peers at

Priority paging tries to prevent pages being stolen from memory through the page
scanner if they belong to processes private memory. Under these circumstances
the page scanner first tries to free memory be just stealing pages from the
filesystem caches. It can be enabled in Solaris 2.6 (after at least having
kernel patch level 105181-13 applied) by adding this line to /etc/system:
set priority_paging=1

Adding up the RSS colum values are not usefull because these values include both
Private and shared memory (So you may by adding the same memory pages multiple
times for different processes)

My solution:
I need to monitor some more now that I know what I'm looking at. Th sr column
varies a lot, idle some times, high at other times, but maybe not high enough to
indicate an immediate memory shortage.

iostat indicates one disk with slow seek latency... this may point at a possible

My Original Question:
I need to make sense from these numbers.

# swap -l ; vmstat
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 32,1 16 4194272 3178256
 procs memory page disk faults cpu
 r b w swap free re mf pi po fr de sr f0 m0 m1 m2 in sy cs us sy id
 0 0 0 21984 27104 7 74 552 101 586 0 122 0 2 7 4 447 2013 661 2 2 96

The first two lines (output from swap -l) seems to indicate that aproximately 1
Gb is swapped.

The last line seems to indicate that 2 Gb is swapped.

The system has got 4 Gb Swap space and a total of 1.5 Gb physical RAM.

The system is very slow.

I want to try and find out what process(es) is(are) actually swapping so much.

More-over: If I sum the "top" process data for the first 40 processes, sorted
by size, I get a total of 7.7Gb for the process data. The total size of
"Resident" parts are 6.8Gb

These numbers don't make sense to me. Something has got to be wrong!

for what it's worth, This is Solaris:
# uname -rsv
SunOS 5.6 Generic_105181-20

Any ideas?

U BEFORE POSTING please READ the FAQ located at
. and the list POLICY statement located at
A To submit questions/summaries to this list send your email message to:
A To unsubscribe from this list please send an email message to:
E and in the BODY type:
R unsubscribe sun-managers
S Or
. unsubscribe sun-managers original@subscription.address
L To view an archive of this list please visit:

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:15 CDT