How much size should swap partition should be

Asked by Karthik. B

I installed ubuntu in my system with 80GB harddisk and 512MB Ram with intel pentium D dual core. I somewhere read that swap size should be double the physical memory. So I reserved for swap partition 1GB. But my problem is that am i wasting that 1GB space for swap. Is that necessary for me to reserve 1GB for swap. I don't work on extensive graphical programs. Even i don't play games that uses extensive graphics. How to shrink the swap size and add it to other partitions like /.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Luca Falavigna (dktrkranz) said :
#1

You can use gparted by launching sudo gparted command in a terminal window. Reserving too much swap space is useless, unless you use applications which needs tons of RAM (such as VMware). You should consider to reserve 256 Mb and, if you will ever need to increase it, you can do so with a swap file using dd, mkswap and swapon commands.

Revision history for this message
Rogelio Castillo A. (rogelio2k) said :
#2

i think that is good idea... 256 mb of swap... only if you don't use a big apps (vmware)

my inglish.... :( jeje

bye

Revision history for this message
Karthik. B (karthik-bhuvana) said :
#3

Thank u for your answers. But how can i resize swap to 256 MB or more and add the rest to ubuntu filesystem partition. In gparted i'm unable to resize swap partition.
         One more thing is, with gparted can i add empty widows partition to ubuntu filesystem partition?

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) said :
#4

You can safely delete a swap partition and re-create it at the end of the disk as only 256MB. Then resize up the other partitions to use the space which has become available.

Personally I disagree that 256MB is enough, but it's your system :)

Revision history for this message
Karthik. B (karthik-bhuvana) said :
#5

Can't we increase ext3 partition on which presently ubuntu is installed which i'm currently working on it using GParted or GParted LiveCD.

Revision history for this message
Vadym Abramchuck (abramzzz) said :
#6

In my mind, you should use at least 512 mb. 1024 will be ok :)

Revision history for this message
Olsmithy (sean-hostinghabitat) said :
#7

A good rule of thumb for swap is always use equal to that of your amount of RAM. It's just 1 gig after all and having it really does help. Sure my suggestion may be a little over zealous but hard drive space is nothing compared to that of RAM and it keeps even the most hardcore applications like a busy mysql server at bay.

Can you help with this problem?

Provide an answer of your own, or ask Karthik. B for more information if necessary.

To post a message you must log in.