Swap Space! Whats this?

Discussion in 'Linux, BSD and Other OS's' started by Karanislove, Aug 7, 2006.

  1. Karanislove

    Karanislove It's D Grav80 Of Luv

    Likes Received:
    0
    Trophy Points:
    36
    Whenever I install Ubuntu on my system, I get one message that you havent specified any swap space, press Yes to go back to the partition table otherwise you will get system speed lag somthing..........

    It's a big paragraph I cant remember the whole but Linux users might have got idea after reading this...
     
  2. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    Where to begin? In Windows, the OS takes a big chunk of your HDD and uses it for a VM pagetable, or swap file. This, in theory anyway, is supposed to be that when Windows runs out of memory to use, it falls back on the swap file to use the HDD like fake RAM, moving the less-commonly called stuff from RAM to the HDD in order to make more room. Unfortunately, Windows memory management is horrible (sorry Windows fans, it is), and it doesn't actually work out that way. In fact Windows uses the swapfile almost constantly, no matter how much RAM is free. Listen to a redbook audio CD in your Windows PC sometime and watch the HDD activity LED on your chasis go completely nuts.

    In contrast, Linux, BSD and other unices only use the swap file when it's absolutely necessary to do so. So with a machine that has a lot of RAM, your system will almost never swap. Also unlike Windows, Linux uses a swap partition rather than just swapping to radom parts of the HDD. This is for both security and data integrity. It's a good idea to have at least a small one, even if you never use it. In a system with >=512mb of RAM, 128-256mb swap partition is plenty. On systems with less than 512, or if you routinely work with huge files on your system, you may want a larger swap. Again, you'll probably almost never use it, so anything over 256 is usually a waste.

    Hope this answers your question... :p
     
  3. Karanislove

    Karanislove It's D Grav80 Of Luv

    Likes Received:
    0
    Trophy Points:
    36
    Thanks for making things clear AT...
    Just one more question, how to set this swap space coz whenever I tried to install Ubuntu after pressing "Done partitiong drives continue loading windos(something like that!)" I recieve this message that if I have no swap space created. How do I create it?
     
  4. megamaced

    megamaced Geek Geek Geek!

    Likes Received:
    0
    Trophy Points:
    36
    Which ubuntu installer are you using? The 'Desktop Install' or the 'Alternative Install' CD?

    In the latter's case, you have to create a new partition and assign it as swap space.
     
  5. zeus

    zeus out of date

    Likes Received:
    0
    Trophy Points:
    36
    I remember reading somewhere that its best to put swap space at the beginning of the drive. Not that I ever have! But as long as you have a reasonble amount of RAM it will never be used anyway, I dont think ive ever run into my swap space and for a long time I only had 512mb RAM.
    Like AT said, windows uses it all the time, its daft!
     
  6. Karanislove

    Karanislove It's D Grav80 Of Luv

    Likes Received:
    0
    Trophy Points:
    36
    I have 512Mb of RAM and I am not sure which installer is it but it asks me to create the swap space mannually. So I believe its desktop installer.
    BTW, do I need to create the swap space?
     
  7. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    Yes. It is a seperate partition formatted with the special swap filesystem. Linux won't swap anywhere but there.
     
  8. Karanislove

    Karanislove It's D Grav80 Of Luv

    Likes Received:
    0
    Trophy Points:
    36
    Sweet! I will try it out when I reach home... but I am not exactly sure how to set this setting..
     
  9. zeus

    zeus out of date

    Likes Received:
    0
    Trophy Points:
    36
    Its just a partition with the file system Linux Swap. When you create your ext3 partition create a Linux Swap one too.
    Even things like Partition Manager and Partition Magic can create then if your get really stuck.
     

Share This Page