Re: why swap at all?

From: Matthias Schniedermeyer
Date: Wed May 26 2004 - 05:16:03 EST


On Wed, May 26, 2004 at 07:48:10PM +1000, Nick Piggin wrote:
> John Bradford wrote:
> >Quote from Nick Piggin <nickpiggin@xxxxxxxxxxxx>:
> >
> >>Even for systems that don't *need* the extra memory space, swap can
> >>actually provide performance improvements by allowing unused memory
> >>to be replaced with often-used memory.
> >
> >
> >That's true, but it's not a magical property of swap space - extra physical
> >RAM would do more or less the same thing.
> >
>
> Well it is a magical property of swap space, because extra RAM
> doesn't allow you to replace unused memory with often used memory.
>
> The theory holds true no matter how much RAM you have. Swap can
> improve performance. It can be trivially demonstrated.

The other way around can be "demonstrated" equally trivially.

In my personal machine i have 3GB of RAM and i regularly create
DVD-ISO-Images (about 2 per day). After creating an image (reading up to
4,4GB and writing up to 4,4GB) the cache is 100% trashed(1). With swap
it would be even more trashed then it is without swap(1).




1: This has "always(tm)" been so since i began burning DVDs 3 years ago.
Beginning from kernel 2.4.4-2.4.25 and 2.6.4-2.6.6. Currently i use 2.6.5. (This is no typo!)

I have only tested the "with swap"-case with 2.4.4 as i didn't use swap
after 2.4.4 trashed so badly with swap enabled. But i don't think that
things have changed so fundamentaly that the "with swap"-case is
better(FOR ME!) than the "without swap"-case.


Bis denn

--
Real Programmers consider "what you see is what you get" to be just as
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated,
cryptic, powerful, unforgiving, dangerous.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/