Art Alexion on 19 Aug 2009 12:25:18 -0700

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

Re: [PLUG] Swap on SD

On Wednesday 19 August 2009 14:34:29 Richard Freeman wrote:
> Art Alexion wrote:
> > So what happens to a Linux system without swap that runs out of physical
> > memory?  
> Linux has a routine called the out-of-memory killer that takes case of
> this.  The name does a good job of implying how it works.  Processes are
> killed and their memory is freed.  The algorithm attempts to get the
> most space from the fewest killed processes, with some emphasis on
> trying to find ones the user won't mind losing too much.
> Processes that were recently started that use lots of RAM and are niced
> and don't have admin privileges tend to be the first to go.
> > how does it manage that extra memory demand?  
> Once memory has been freed - just like any other request for RAM.
>  > My guess is, whatever
> > it does is not as fast as if it could use swap.  
> Oh, I suspect that the OOM killer is a whole lot faster than swap, for
> the same reason that torching your house is a whole lot faster than
> renting a uhaul and a storage shed.
>  > If that wasn't the case, it
> > would seem that no system would ever benefit from swap.
> Well, in the sense that in an office with a really big paper shredder
> has no need for filing cabinets, that would be correct.
> Suffice it to say, running out of RAM on a linux system isn't a good
> thing.  The OOM killer is a good solution to some process going nuts and
> allocating GBs of RAM, but otherwise it is the sledge hammer solution.
> Keep in mind that swap also allows for infrequently accessed data to be
> swapped out in favor of disk cache, so it can in theory benefit a system
> even when all of the physical RAM is not needed for process working space.

Once you answered with OOM, the rest of my questions made no sense.  I raised 
them in anticipation that it would create ad hoc swap in the form of lots of 
little temp files (a la MS Word).  For all practical purposes, based on what 
you and Mark say, Linux _doesn't_ handle out of memory situations, short of 
committing little suicides.

All of that said, I am going to continue with my SD solution as it seems 
better than no swap at all, and after using the thing for about 4 hours since 
setting up the SD swap, it does feel snappier when a number of apps are 

Maybe I'll go with a piece of duct tape over the slot so as to minimize 
ejecting the card by accident.

Attachment: signature.asc
Description: This is a digitally signed message part.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --