Re: About the need of a swap area

From: DervishD (raul@pleyades.net)
Date: Sat Jul 27 2002 - 11:11:27 EST


    Hi Ville :)

>> I read a time ago that, no matter the RAM you have, adding a
>> swap-area will improve performance a lot. So I tested.
>Well, no. I don't know where you read it, but that's wrong.

    I don't remember clearly. Maybe at linux-gazette or someplace
like that. Moreover, maybe I take the phrase out of context.

>Where swap helps perfomance is when you can swap _inactive_ (parts of)
>programs out, and use the freed memory for disk cache.

    Yes, that makes sense, obviously. My question is more: when an
inactive page will be swapped out? Only when there is no more RAM
left? When free RAM goes below some point? How to configure it?

>> the memory is not prone to be filled.
>So you have 512MB of RAM? All the programs (without X) will fit
>there easily. You'll still have plenty for disk cache.

    Except when I'm compiling something large, the memory is almost
entirely free. I have a lot of memory for having a lot of cache, so
when I develope things go real fast. For example, I use gcc, make and
binutils (and an editor) most of the time. Well, thanks to the disk
cache, the first time they are run is the only disk access...

    Moreover, sometimes I use ram disks.

>BUT: if something unexpected happens - a programs goes out of
>control and eats heaps of memory - the swap can save you.

    But in such a case, highs are the chances of the program crashing
due to a memory error if there is no swap. I really don't understan
why swap may save me in this case O:)) Maybe the swap-in, swap-out
will make that process slower and I have some spare CPU to be able to
kill the program?

>Hope this helps.

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



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:26 EST