View previous topic :: View next topic |
Author |
Message |
Debug_This n00b
Joined: 22 Feb 2006 Posts: 15 Location: Connecticut, United States
|
Posted: Fri Feb 24, 2006 12:04 am Post subject: [solved] Size of swap partition |
|
|
I don't know if this really matters, but I've noticed a little discrepency in the size of the swap partition in Chapter 4 of the Gentoo Handbook. The actual install guide says make it 512MB, but some of the examples it gives have different sizes. Should I just go with the suggested 512MB?
Also, on a side note, I'm not really clear on what this partition is for. I understand /boot is for booting the OS and / is the root directory of the whole operating system, but what is swap for? The only thing I can think of is like a Temp directory, but I'm not sure.
Last edited by Debug_This on Fri Feb 24, 2006 8:33 pm; edited 1 time in total |
|
Back to top |
|
|
markkuk Guru
Joined: 29 Nov 2002 Posts: 446
|
Posted: Fri Feb 24, 2006 12:14 am Post subject: |
|
|
Swap partition is used for the virtual menory backing store. 512MB is OK for normal desktop use, for things like image processing you may need more. |
|
Back to top |
|
|
Debug_This n00b
Joined: 22 Feb 2006 Posts: 15 Location: Connecticut, United States
|
Posted: Fri Feb 24, 2006 12:18 am Post subject: |
|
|
Ahh, so it's like the pagefile in Windows.
I will proceed with the install, making my swap 512MB as suggested (it's usually only really used when RAM is used up right?) |
|
Back to top |
|
|
lenkki n00b
Joined: 03 Mar 2004 Posts: 55
|
Posted: Fri Feb 24, 2006 12:19 am Post subject: |
|
|
The swapfile is the same as the pagefile in windows. If I'm not misstaken a general rule of thumb is to make it twice the size of your main memory. Allthough I don't know why they say so, and imo the more memory you have the less swap you should need...
Myself I have 1gb of system memory and 256mb swap, and due to a few factors I didn't foresee with my multiboot disk partitioning I also have a 8gb empty partition that I use as swap some times when I need it ( I do some developing and sometimes need to process images that are 1gb in size on disk, so it's nice )
But anyhow if you wanna be safe make the swap partition twice the size of your system memory.
My gentoo + gnome system hardly uses 200mb of memory at any normal usage so I hardly ever use the swapspace really. (excluding games and some other heavy tasks that normal users probably won't be doing |
|
Back to top |
|
|
Debug_This n00b
Joined: 22 Feb 2006 Posts: 15 Location: Connecticut, United States
|
Posted: Fri Feb 24, 2006 12:25 am Post subject: |
|
|
lenkki wrote: | (excluding games and some other heavy tasks that normal users probably won't be doing |
I don't think I will be doing any heavy image processing, but I definitely plan to run some 3D games (nothing like HL2 or FarCry, but still). I have 512MB of memory in this system, so in theory I should have a 1024 (1 gig) swap partition, right?
I'm not that far into the install and don't mind reformatting. Please let me know what you think. |
|
Back to top |
|
|
Joseph_sys Advocate
Joined: 08 Jun 2004 Posts: 2712 Location: Edmonton, AB
|
Posted: Fri Feb 24, 2006 12:33 am Post subject: |
|
|
The general rule is to make swap partition 2 x your RAM.
Here is also an interesting article how increase swap partition if you make it too small by mistake (like I did).
http://enterprise.linux.com/enterprise/05/03/02/2250257.shtml?tid=129&tid=42
I have AMD64 with 1GB of RAM and I only created 1GB swap partition. I experienced some strange hang-ups (total freeze) during some memory intensive work. So I'm not sure if this could be attributed to a small swap space on not but I decided to double it.
I had a hard time to find any clear and relatively secure instruction on how to modify (resize) the partition to increase the swap space without putting the system at risk. But I run onto this article that describes how to "Increase your available swap space with a swap file" which seems very secure and that is what I've done. |
|
Back to top |
|
|
Debug_This n00b
Joined: 22 Feb 2006 Posts: 15 Location: Connecticut, United States
|
Posted: Fri Feb 24, 2006 12:37 am Post subject: |
|
|
That might also have to do with the fact that you were running a 64-bit processor. Since they can handle double the amount of memory (physical+virtual), I doubt the 2x rule applies when your talking 8 gigs as oppossed to 4. I appreciate the info though! |
|
Back to top |
|
|
Joseph_sys Advocate
Joined: 08 Jun 2004 Posts: 2712 Location: Edmonton, AB
|
Posted: Fri Feb 24, 2006 12:55 am Post subject: |
|
|
Debug_This wrote: | That might also have to do with the fact that you were running a 64-bit processor. Since they can handle double the amount of memory (physical+virtual), I doubt the 2x rule applies when your talking 8 gigs as oppossed to 4. I appreciate the info though! |
I'm not sure if the same rule reply if it comes to 64-bit processor. But to be on the safe side I'm trying to eliminate all possible causes.
I know I had a bad memory stick and I couldn't even finish the installation correctly; I had to replace one memory stick. But when I run some memory test I still get some errors at time to time.
So, it is hard to tell what it is at fault but, when I was processing some large graphics files and was burning DVD sometime the system had a total freeze, the only button that worked was a power switch.
I have 1-GB and after few days of running the system the memory stays free at 500 - 600Mb depends how many applications I'm running at the same time. |
|
Back to top |
|
|
broken_chaos Guru
Joined: 18 Jan 2006 Posts: 370 Location: Ontario, Canada
|
Posted: Fri Feb 24, 2006 1:01 am Post subject: |
|
|
Personal experience, I don't even need a swap partition with a gig of RAM. I've seen maybe half of it used at once (although I hardly do memory intensive things). Even on another box with 768 megs, I find a swap partition a waste personally. But that's just me.
Overall, for a 512 machine, I'd suggest at least a 512 swap partition. You could go for a gig if you wanted as well. |
|
Back to top |
|
|
Debug_This n00b
Joined: 22 Feb 2006 Posts: 15 Location: Connecticut, United States
|
Posted: Fri Feb 24, 2006 1:31 am Post subject: |
|
|
Thanks for clearing that up joseph, and thanks for the suggestion chaos. I am going with the 1 gig swap partition just to be safe (with a 120GB HDD I'd rather dedicate more space than I need to swap than less -- although joseph, that was a very useful article and it linked me to another good one on LVM).
OT: While checking some info on 64-bit processors at Wikipedia, I stumbled across a mention of Gentoo in this article:
Quote: | 64-bit Linux has become more common in recent years. While finding prepackaged binaries for 64-bit systems has been a problem for some users, many Linux software packages can simply be compiled from source to work in a 64-bit environment. Gentoo Linux supports a very robust 64-bit environment. One issue is that 64-bit Linux cannot play certain audio and video formats easily, due to closed-sourced codecs that are incompatible with 64-bit media players. A workaround is to use 32-bit versions of those media players with the codecs, thus enabling playback of those formats. |
Just FYI in case anyone was interested
BTW, just the thought of posting and surfing the web during the installation of an operating system is mind-blowing to me. |
|
Back to top |
|
|
Keruskerfuerst Advocate
Joined: 01 Feb 2006 Posts: 2289 Location: near Augsburg, Germany
|
Posted: Fri Feb 24, 2006 12:00 pm Post subject: |
|
|
swap size should be >3/2 of RAM size, if you use suspend to disk. In this case, the swap partition is used for saving the RAM. |
|
Back to top |
|
|
|