Page 1 of 1

default partition sizes on Ubuntu 8.04

Posted: Wed Jul 30, 2008 8:37 am
by Marin85
Hi,
just a small question: can someone post the default swap partition sizes on Ubuntu 8.04 both x64 and x86. Does the swap partition size vary depending on machine specs (provided the same OS installed)?

Marin

Re: default partition sizes on Ubuntu 8.04

Posted: Wed Jul 30, 2008 9:06 am
by aaa
Marin85 wrote:Does the swap partition size vary depending on machine specs (provided the same OS installed)?
Yes.

Posted: Wed Jul 30, 2008 9:11 am
by Marin85
Thanks. I guess this answers both questions :)

Marin

Posted: Wed Jul 30, 2008 6:25 pm
by jglen490
To some extent, the answer "Yes" is correct. There is a point beyond which more swap is a waste of space.

The old rule of thumb is 2X RAM. But when modern machines have multi-GB RAM, that thumb needs to go out the window. A new rule might be no less than 512MB, and more only if you are doing extraordinary things such a CAD, photo editing, and the like. ANd for light use with multi-GB RAM, no swap is fine.

So it's not so much machine specs as it is machine utility. 512MB is pretty good target for most mortals.

AT present, my top output looks like this with about 500MB of swap:

Code: Select all

Tasks: 117 total,   3 running, 114 sleeping,   0 stopped,   0 zombie
Cpu(s):  7.2%us,  2.6%sy,  0.0%ni, 90.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    385792k total,   379040k used,     6752k free,    12728k buffers
Swap:   498004k total,    34700k used,   463304k free,   178980k cached

Posted: Wed Jul 30, 2008 6:34 pm
by gongo2k1
remember, if you want hibernation to work, swap should be at least equal to your ram. in general though, there's not much point since standby is faster and doesn't take a whole lot of power.

Posted: Wed Jul 30, 2008 6:59 pm
by Marin85
Thanks a lot for your replies! Very helpful indeed!

Marin

Posted: Wed Aug 06, 2008 7:33 am
by mikeh
gongo2k1 wrote:remember, if you want hibernation to work, swap should be at least equal to your ram. in general though, there's not much point since standby is faster and doesn't take a whole lot of power.
I don't think so. If you have enough RAM, a lot of it is used for buffers and cache, which doesn't need to be saved in hibernation.
Hibernate is useful if you have to dual-boot into windows.

Posted: Wed Aug 06, 2008 1:15 pm
by aaa
Actually, what do you think happens when you use so much memory that it spills over into swap? Opening a 3-gig image or something, and you only have 1g ram/3g swap, not enough for the image+rest of OS.

Posted: Wed Aug 06, 2008 7:49 pm
by mikeh
AFAIK, there is nothing special about having the same swap space as RAM.
Whether it is bigger or smaller, if your memory use (excluding buffers and cache)
is bigger than swap, hibernation will fail. Actual physical RAM size is irrelevant.
So whether you have 1GB or 3GB of RAM, 2GB of swap is probably plenty.
As for your example of opening a 3GB image, thats no a problem. It is either read a bit at a time, or mmap()ed. In the latter case, its just loaded to cache as needed, and never gets written to swap.
(stddisclaim: correct me if wrong)