Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Mar 2015
    Location
    Cary, North Carolina, U.S
    Posts
    212

    Is SWAP Necessary


    Hey everyone, I just recently copied my Ubuntu 15.04 partition to another drive (just to experiment with something) with Gparted and everything went well. The only problem is that I realized that the new copied partition doesn't have SWAP. Usually I didn't worry too much about SWAP because the installation process will usually set it up for me. However, in this case is SWAP something I should be really worried about? I have seen some links on how to add, or enable, SWAP but should I go through them or no? I'm not really familiar with SWAP at all and I don't really know whether it is that important or not. But so far I haven't seen any differences.

    Thanks for answers.
    Learn Python by examples and explanations.

    www.y-t-pythonexamples.jimdo.com

  2. #2
    It's a contentious issue for some. In the past there was a rule to have swap twice the size of RAM, so 500meg of RAM would suggest 1gig of swap. Then RAM became much larger and swap was less used by the operating system, and even not used at all, so another rule did the rounds of one and half times RAM. But swap was not always used, so the suggestion of swap equal to RAM was proposed, and some got rid of swap altogether because they had a lot of RAM anyway ... say 8gig plus. On laptops however, there was some hibernation process where the whole of what was in RAM needed to be saved for the process to work ... something like that anyway ... so having swap equal to RAM was fashionable. The problem with having no swap at all is that when RAM is fully used, the machine will have no other space to page stuff out and let RAM do it's work, so machines can lock up in these circumstances. So, take your pick of which argument you favour, and there are heaps online, but since you asked, I would say, swap may not be technically necessary if you have lots of RAM, but I personally do the 1.5 times RAM quantity.

  3. #3
    Important for machines that are lacking in processor power. Important when applications like Browsers eat yr ram like Iceweasel does and the OS needs virtual ram - so yes swap is still important.

  4. $spacer_open
    $spacer_close
  5. #4
    Depends on the gear for me.

    Code:
    harry@biker:~
    $ free
                 total       used       free     shared    buffers     cached
    Mem:       8238256     828924    7409332      46188      23576     312168
    -/+ buffers/cache:     493180    7745076
    Swap:            0          0          0
    harry@biker:~
    $ sudo parted -l
    [sudo] password for harry: 
    Model: ATA KINGSTON SV300S3 (scsi)
    Disk /dev/sda: 60.0GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags: 
    
    Number  Start   End     Size    Type     File system  Flags
     2      1049kB  8390MB  8389MB  primary  ext3
     1      8390MB  60.0GB  51.6GB  primary  ext3
    
    
    harry@biker:~
    $ inxi -f
    CPU:       Dual core Intel Core i5 M 520 (-HT-MCP-) cache: 3072 KB 
               clock speeds: max: 2400 MHz 1: 1599 MHz 2: 2400 MHz 3: 1199 MHz
               4: 2133 MHz
               CPU Flags: acpi aes aperfmperf apic arat arch_perfmon bts clflush
               cmov constant_tsc cx16 cx8 de ds_cpl dtes64 dtherm dts ept est
               flexpriority fpu fxsr ht ida lahf_lm lm mca mce mmx monitor msr
               mtrr nonstop_tsc nx pae pat pbe pcid pclmulqdq pdcm pebs pge pni
               popcnt pse pse36 rdtscp sep smx ss sse sse2 sse4_1 sse4_2 ssse3 tm
               tm2 tpr_shadow tsc vme vmx vnmi vpid xtopology xtpr
    No /swap on this netbook. But /swap is needed on My IBM T23 laptop AntiX install. With a P3 and 1 gig of ram.

    Edit: Depends on what you use the computer for also. I do not know if you compile kernels and do video editing or website developing or what.
    If just a home user. My rule of thumb is if single core processor with a platter hard drive. It does not hurt to assign a minimum of 2 gig of /swap
    and work your way up to like say 6 gig if room is on the drive for this because you never know when it might be needed.

  6. #5
    Linux Newbie
    Join Date
    Mar 2015
    Location
    Cary, North Carolina, U.S
    Posts
    212
    -->
    Thanks guys for your advice.

    I went ahead and put 8GBs of SWAP.
    Learn Python by examples and explanations.

    www.y-t-pythonexamples.jimdo.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •