Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Size of swap partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Debug_This
n00b
n00b


Joined: 22 Feb 2006
Posts: 15
Location: Connecticut, United States

PostPosted: Fri Feb 24, 2006 12:04 am    Post subject: [solved] Size of swap partition Reply with quote

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
View user's profile Send private message
markkuk
Guru
Guru


Joined: 29 Nov 2002
Posts: 446

PostPosted: Fri Feb 24, 2006 12:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Debug_This
n00b
n00b


Joined: 22 Feb 2006
Posts: 15
Location: Connecticut, United States

PostPosted: Fri Feb 24, 2006 12:18 am    Post subject: Reply with quote

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
View user's profile Send private message
lenkki
n00b
n00b


Joined: 03 Mar 2004
Posts: 55

PostPosted: Fri Feb 24, 2006 12:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Debug_This
n00b
n00b


Joined: 22 Feb 2006
Posts: 15
Location: Connecticut, United States

PostPosted: Fri Feb 24, 2006 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Fri Feb 24, 2006 12:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Debug_This
n00b
n00b


Joined: 22 Feb 2006
Posts: 15
Location: Connecticut, United States

PostPosted: Fri Feb 24, 2006 12:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Fri Feb 24, 2006 12:55 am    Post subject: Reply with quote

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
View user's profile Send private message
broken_chaos
Guru
Guru


Joined: 18 Jan 2006
Posts: 370
Location: Ontario, Canada

PostPosted: Fri Feb 24, 2006 1:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Debug_This
n00b
n00b


Joined: 22 Feb 2006
Posts: 15
Location: Connecticut, United States

PostPosted: Fri Feb 24, 2006 1:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Keruskerfuerst
Advocate
Advocate


Joined: 01 Feb 2006
Posts: 2289
Location: near Augsburg, Germany

PostPosted: Fri Feb 24, 2006 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum