[ale] Swap Memory usage

Greg Freemyer freemyer-ml at NorcrossGroup.com
Fri Sep 19 14:04:56 EDT 2003


On Fri, 2003-09-19 at 13:34, John Wells wrote:
> Greg Freemyer said:
> > On the otherhand, once data is moved to swap it is left there until it
> > is deleted.
> 
> I thought the point of swap was to move lower priority data into the swap
> to free up RAM, but then move it back into RAM if its need becomes a
> priority again.  In other words, if an app that uses the data is currently
> in memory and running, any swapped data it uses would be loaded back into
> main RAM provided space was available.  Is this not the case?
> 
> John
> 
The above is correct, but your phrase "but then move it back into RAM if
its need becomes a priority again" is slightly incorrect.

I believe you should say "but then _copy_ it back into RAM if its need
becomes a priority again, but keep that specific page of swap reserved
for future use of this specifc page of RAM"

Also, in your write-up it sounds like you are talking about entire
programs/data being swapped out and back in.  Whole programs/data can be
swapped out if they are not in use, but only pages are ever brought back
in.  And they are only brought in if the cpu references memory in that
specific block of virtual memory.

Also, once all the rarely used programs have been swapped out, the VM
system will start looking for individual unused RAM pages and swap them
out.

That works well because most apps have large portions that only get used
under rare circumstances.  (ie. Error messages, etc.)

The end result is that swap space usage can be very efficient and not
cause performance issues.  

That is why tuning books don't normally talk abut your total swap usage.

Instead they typically focus on swap-ins per second.  Those kill
performance.

Greg 
-- 
Greg Freemyer










More information about the Ale mailing list