swap file size question
Hi all, I'm a newbie. I've set my swap file to 640Mb, as this is twice the size of the amount of RAM that I have(320Mb). Is this total overkill or not, and if so, what is an appropriate size? If it means repartitioning and reloading linux,I am totally prepared to do this ie no harm done.
Technically, there is no such thing as overkill with swap. It just a matter of how much hard drive space you think it's worth wasting. There is no other harm done in adding much swap.
There is really just one guideline to follow: The sum of RAM and swap is the amount of memory avaliable to your system, in your case almost 1 GB. In reality, only enterprise-level servers or scientific simulation computers use that much memory, but if you don't miss the hard disk space really much, it doesn't hurt, either.
With 320 MB of RAM, it's very possible that the swap space isn't used at all, but if it would be needed by anything, it's a really good thing. There are also buggy programs with memory leaks that just grow if you don't restart them, and having lots of memory at least hinders the kernel from killing when memory gets tight (although most programs require pretty much time to grow to 320 MB, not to mention 1 GB). I believe that nVidia's userspace drivers have memory leaks, since my X server keeps on growing. I have 512 MB of RAM, but X sees to it that the swap is used anyway.
yes, for 2.x kernels 2 * ram = swap. With 3.0 (2.6?) kernel coming up here soon they have a different implimentation of the swapping algorithm that needs only swap = ram.
What do you mean with swap = 2 * ram? Why would one want that? Have I missed anything?
the guidline for a long time has been swap space = 2 * your RAM in MB
swap= 2 * ram
so make a 640 MB swap if you have320 MB's of RAM
that's what it means
I did understand what it meant, but I don't understand why'd you want to do it like that? Swap+ram is always the amount of memory you get. Shouldn't that be enough?
right - wassy was saying you can basically triple the amount of memory you rsystem has (in RAM) by adding 2x it in swap
one of the first things off google, rule of thumb for swap is 2x RAM - but as it admits is wrong as often its right.
RAM + SWAP = effective memory
but if you make your swap partition 2x your RAM you are giving yourself more effective meomry if you will, its more from the days of smaller memory - nowadays its stupid, but still a carryover
In all RH installations that I've seen, dating back to 6.1, it says as a rule of thumb to make the swap 16 MB or equal to the amount of RAM, whichever is largest. That, too, seems quite stupid.
wow, I have heard 2*ram from the kernel mailing list, something to do with worst case scenario performance of the virtual memory manager. I don't pretend to understand it.
That must apply only to very special systems, such as those with very, very little RAM.