Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I noticed this question has not been asked directly;

What is this "Swap Area" people keep referring to when it comes to installing Ubuntu?

share|improve this question
7  
Does this question help? –  muru Aug 9 at 3:08
5  
Related: SwapFaq –  Eliah Kagan Aug 9 at 3:09
    
Have you consider any answer to accept? –  Pandya Sep 3 at 17:49
    
@Pandya Nope; I am holding out for a answer with visual aids. –  Akiva Sep 4 at 1:14

2 Answers 2

The Swap Area is basically extra RAM that lives on your hard drive. The Windows equivalent would be the Pagefile. It is much slower than physical RAM, but is necessary in many cases to keep a system running smoothly.

You can either make a separate partition for your Swap Area (recommended), or you can go the windows way and make a Swap File on your system partition (not recommended).

A good baseline if you have no idea how big to make it (and the default in the Ubuntu installer) is to have the same amount of swap as you do RAM. That being said, this is only a very general guideline, and depends on how you use your system. There is nothing wrong with having no swap space. If you start running out of RAM, just make your swap space larger.

See also:

share|improve this answer
    
You can either make a separate partition for your Swap Area (recommended) - why so? Works great for me. –  jco Aug 9 at 10:46
    
The default installer on Ubuntu 14.04 in fact creates a 16GB swap partition if you have 16GB RAM. So your recommendation is already the default now. –  jmiserez Aug 9 at 13:54
1  
@jco In the case that the file is not fragmented, it will have identical performance to a swap partition because the kernel bypasses the file system in recent versions. If you create the swap file at installation this is likely the case, but not guaranteed. If you change the swap file at a later date, it will likely fragment. Therefore it is easier to make a swap partition which is guaranteed to be contiguous on disk. Also, a partition is recommended if you want to try and hibernate. –  TheSchwa Aug 9 at 17:30
    
@JeremieMiserez Thanks, I didn't realize that as I always partition manually when installing Ubuntu. Updated wording in answer to reflect that. –  TheSchwa Aug 9 at 17:31
    
@TheSchwa Thanks for the info. I have an encrypted swap file that I created after installation. I chose it because it seemed much more practical, because I didn't want to clock up my precious SSD space with 20GB that would mostly go unused, and because I would be getting more RAM and planned on increasing the swap size. Is there a way to make sure it doesn't fragment? –  jco Aug 11 at 8:11

From Community Help:

  • Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space temporarily holds memory pages that are inactive.
  • Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. If the system happens to need more memory resources or space, inactive pages in physical memory are then moved to the swap space therefore freeing up that physical memory for other uses.
  • Note that the access time for swap is slower therefore do not consider it to be a complete replacement for the physical memory.
  • Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files.

Also visit:-

  • wikipedia paging:

    With a swap partition one can choose where on the disk it resides and place it where the disk throughput is highest. The administrative flexibility of swap files can outweigh the other advantages of swap partitions. For example, a swap file can be placed on any drive, can be set to any desired size, and can be added or changed as needed. A swap partition, however, is not as flexible as a file, as it cannot be changed without using tools to resize it, generally outside the operating system that uses the swap partition.

    Linux supports using a virtually unlimited number of swapping devices, each of which can be assigned a priority. When the operating system needs to swap pages out of physical memory, it uses the highest-priority device with free space.

  • http://stackoverflow.com/q/4970421 (Difference between virtual memory & swap area)

  • Linux.com - swap space

    Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.

  • Importance of Swap Partition


Hope this helps to understand and get basic knowledge about swap.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.