[haiku] Re: Why the MMU?

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sat, 13 Dec 2008 10:06:33 +0100 CET

Nicholas Blachford <nicholas@xxxxxxxxxxxxxx> wrote:
> Actually I'm not convinced of the need to page to disc these days and  
> with the rise of flash RAM SSD in place of an HD it's actually a  
> rather bad idea.

While you cannot assume any storage to last forever, due to the way VMs 
work, it's not a good idea to turn off swap these days: since many 
applications map more memory they will likely use, the only way to 
actually use all of your physical memory is to back it up with swap 
storage.

For example, the main stack in BeOS is 16 MB in size - with a 64 MB 
machine, you could run at most 3 applications (including things like 
the app_server, the input_server, and then, uh what?), which isn't 
really acceptable at all. However, since an application usually will 
only use a fraction of this, you only have to guarantee that you can 
give it the memory when it needs it - without swap space, you'd have to 
reserve physical memory for this that is not likely to be used.

> Be of course had a very good solution to this, their swap system  
> didn't kick in unless it really, really needed to.  When it did it 
> was  
> incredibly slow.  It silently gave you the hint: don't waste memory!

That's not a good solution, that's a pretty poor solution. Of course, 
the actual use of a swap file should be delayed as long as possible, 
but when it runs, it just shouldn't be incredibly slow :-)

> Anyway swap should probably be deactivated by default in SSD systems  
> and disc written to only if it *really* needs it.  This will not only  
> boost performance (SSD writes are slow) it'll also save power.

Nope. As outlined above, the main idea of swap is to have a backup, not 
to actually use it (as swap space is never as fast as you would like 
to, SSD or not).

Bye,
   Axel.


Other related posts: