On 03.24 Pixel wrote:
> Arnd Bergmann <[EMAIL PROTECTED]> writes:
> 
> > Since 2.4, the situation has changed a bit. You now can have either
> > _no_ swap or swap > 2* phyisical memory, which would be 8GB.
> > Running the system with anything between that (0 < swapspace < 8GB for 
> > you) is considered very bad now and the recommendation remains to 
> > enable swap.
> 
> please don't tell nonsense. having swap is always better, even if swapspace <
> memsize.
> 

The problem seems to be that when you swap out a page, and then swap in agai,
the swap space is not recalled in current swap policy in 2.4. So as you said,
if you never strenght your box to swap levels, you do not need swap.

The problem is when you just start swapping something out (this is what I
understood from the kernel list).

Say you have 32Mb of ram and 32 mb of swap.
You fill your phisical mem with app1 and app2, 16Mb each.
Then you start one other app3 that uses again other 16Mb chunk.
Follow this steps:                              Mem Used      Swap Used
- app3 tries to start. No mem.                    32              0
- app1 is swapped out (fills 16 Mb of swap)       16             16
- app3 enters main mem (16Mb)                     32             16
- app1 wants to run again                         32             16
- app3 goes out (gets other 16Mb of swsap)        16             32
- app1 goes in (but its swap space is not         32             32
       cleaned to be reused if app1 is swapped
       out again!!)
- app3 tries to go in again                       32             32
- Decision:
  if app1 goes out, reuses its swap space
  if app2 goes out, there is no swap for it -> crash.

So if you ever swap, you need so much swap space as all the memory you use.
AFAIK, in short: you want to be able to use 1Gb, define 1Gb of swap, the
amount of ram does not matter. You have to be able to have all you apps
in swap, and then 'select' which ones are 'copied' to main memory to run faster.

-- 
J.A. Magallon                                          #  Let the source
mailto:[EMAIL PROTECTED]                              #  be with you, Luke... 

Linux werewolf 2.4.2-ac22 #3 SMP Fri Mar 23 02:06:00 CET 2001 i686


Reply via email to