Why use swap when there is RAM free?

Derek Broughton derek at pointerstop.ca
Fri Aug 14 14:33:48 UTC 2009


Vincent Arnoux wrote:

> On Thu, Aug 13, 2009 at 16:00, Smoot Carl-Mitchell<smoot at tic.com> wrote:
>> It will when the swapped pages are needed again.  There is no reason to
>> do the I/O when it is not required.
> 
> OK, I had the impression it was smarter to put data back to RAM anyway
> as I will for sure need it at one point... Thanks for the
> explanations.

_You_ might know you'll need it.  The swapper doesn't.  Many pages that end 
up in swap might never be used again.  I remember, in the days when we had 
to worry about such things, on VMS I had a way to mark pages as discardable 
- so that code or data only needed at startup could be just deleted rather 
than swapped out when the memory was needed by something else.  Even if 
Linux has this capability, I suspect most programmers just wouldn't bother 
with it.
-- 
derek






More information about the ubuntu-users mailing list