cancel
Showing results for 
Search instead for 
Did you mean: 

Ubuntu 12.04 Swap files and partitions

Community Veteran
Posts: 1,128
Thanks: 8
Registered: 28-08-2007

Ubuntu 12.04 Swap files and partitions

I found a page about swap files and partitions and would appreciate some advice on necessity and size. I have 3 systems.
1x laptop which only has 20gig of hard drive with only about 16 of it left as I have it dual booting with xp, hd split 40 gig in half for each OS. I have a 500mb swap partition on there due to only having 512mb ram. Not sure if I should have a swap file or partition on there as I don't have hibernate mode.
2xdesktops, one at work which has 1gig of ram and 40gig disk space for the OS. When I installed 12.04 to that I never created any swap space at all and my other desktop at home which has 3gig of ram (haven’t installed 12.04 to that yet but will)
Just wondering what would be the best arrangement for the three systems. 
7 REPLIES
VileReynard
Seasoned Pro
Posts: 10,828
Thanks: 250
Fixes: 10
Registered: 01-09-2007

Re: Ubuntu 12.04 Swap files and partitions

If you don't hibernate you don't need any swap space at all - provided you have sufficient main memory.
So your 512MB is probably sufficient for your 512MB PC.
Since swap partitions and swap files are equally efficient, but as swap files are more flexible, I would go for one of those.
See Google for details on how to create swap files.
Most people provide some swap space - just in case!

Community Veteran
Posts: 1,850
Registered: 11-08-2007

Re: Ubuntu 12.04 Swap files and partitions

the general recommendation, prior to the availability of massive ram, was twice the ram as swap, so, for 512mb ram, make a 1gb swap partition.  even if not using hibernate, this will help smooth the swapping of apps, especially if running video.
with only 20gb of hard drive for both oses, each is going to be pushed for space, not only for the operating system, but any files you save.  i know windows is greedy for space and requires a minimum 15% free space on the drive.  linux requires a little less, around 5-10%.
is it not possible to fit a larger drive into the laptop?
Community Veteran
Posts: 1,128
Thanks: 8
Registered: 28-08-2007

Re: Ubuntu 12.04 Swap files and partitions

Should clear up in case it read wrong but each os has 20 gig each.
VileReynard
Seasoned Pro
Posts: 10,828
Thanks: 250
Fixes: 10
Registered: 01-09-2007

Re: Ubuntu 12.04 Swap files and partitions

I would use a swap file of 512MB and if 'System Monitor' shows it to be heavily used, you could increase it.

Community Veteran
Posts: 1,128
Thanks: 8
Registered: 28-08-2007

Re: Ubuntu 12.04 Swap files and partitions

Thanks the laptop with 20 gig HD and 512ram already has a 512 swap, what would you suggest on the other systems? One with 1gig and 40g HD and the other with 3gig ram and 60gig HD? Worth noting that these are just the system drives, they also have a separate second larger hard drive.
VileReynard
Seasoned Pro
Posts: 10,828
Thanks: 250
Fixes: 10
Registered: 01-09-2007

Re: Ubuntu 12.04 Swap files and partitions

It depends what you run;
For example, on a dual processor with 2GB just running Firefox + BOINC (a Climate change background process), I got this:-

Note that no use was made of the super-ample swap space - nor was all the main memory consumed.
(Total disk space is 1TB + 250GB - two disks).
That image resides in the cloud Grin

Community Veteran
Posts: 1,128
Thanks: 8
Registered: 28-08-2007

Re: Ubuntu 12.04 Swap files and partitions

I had a few tests today on my work desktop which has 1gig ram, I opened every bit of software I could think of and still only used 60% of my ram. I downloaded gparted livecd just in case. I may put some swap on there just for the sake of it, I have 40 gig of space on that partition.  Only got a  1900 athlon. Cpu which was pretty much maxed out all the time.  Smiley