Results 1 to 10 of 20
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-02-2003 #1Just Joined!
- Join Date
- Dec 2002
- Location
- NT,Australia
- Posts
- 13
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.
Cheers, John
- 01-03-2003 #2Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
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.
- 01-05-2003 #3Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
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.
I respectfully decline the invitation to join your delusion.
- 01-06-2003 #4Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
What do you mean with swap = 2 * ram? Why would one want that? Have I missed anything?
- 01-06-2003 #5Linux User
- Join Date
- Jul 2002
- Location
- Daytona Beach, FL
- Posts
- 487
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 meansmajorwoo
Quiet brain, or I\'ll stab you with a Q-tip.
- 01-06-2003 #6Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
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?
- 01-06-2003 #7Linux User
- Join Date
- Jul 2002
- Location
- Daytona Beach, FL
- Posts
- 487
right - wassy was saying you can basically triple the amount of memory you rsystem has (in RAM) by adding 2x it in swap
http://www.holland-consulting.net/te...isks.html#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 carryovermajorwoo
Quiet brain, or I\'ll stab you with a Q-tip.
- 01-06-2003 #8Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
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.
- 01-06-2003 #9Linux Enthusiast
- Join Date
- Jun 2002
- Location
- San Antonio
- Posts
- 621
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.
I respectfully decline the invitation to join your delusion.
- 01-06-2003 #10Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
That must apply only to very special systems, such as those with very, very little RAM.


Reply With Quote
