Ubuntu 10.10 not using swap

Discussion in 'all things UNIX' started by aigle, Jul 6, 2011.

Thread Status:
Not open for further replies.
  1. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    I have never found my swap space being used. Is it normal? If not, how can I trace the problem and fix it?

    Thanks
     

    Attached Files:

    • swap.png
      swap.png
      File size:
      35.8 KB
      Views:
      988
  2. steve161

    steve161 Registered Member

    Joined:
    Nov 22, 2006
    Posts:
    681
    Location:
    New York
    Hi aigle:

    I have installed Ubuntu on some fairly low-end computers (including my current laptop), and it never uses swap. I just assumed it was Ubuntu being lean and mean as compared to windows, and my complete lack of memory intensive computing. I always lower the swappiness value to 10 but, as an experiment, I guess you could increase it from the default of 60 and see what happens.
     
  3. J_L

    J_L Registered Member

    Joined:
    Nov 6, 2009
    Posts:
    8,738
    I don't have it because of my netboook's limited hard drive space. Faster not using virtual memory anyhow.
     
  4. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    swap is mostly used when your ram reaches more then peak value of its original if you have enough ram then your swap hardly used

    The default value is 60-70 mostly

    http://www.linuxtopia.org/online_bo...nt/rhel_6_resource_management_sec-memory.html


     
  5. NGRhodes

    NGRhodes Registered Member

    Joined:
    Jun 23, 2003
    Posts:
    2,381
    Location:
    West Yorkshire, UK
    Not always faster ;), some use-cases it can be more performant/efficient to page out dormant but used address space from memory to swap and free the space for buffers and cache.

    http://lwn.net/Articles/100978/ benchmarks show that I/O can suffer by 50% .

    For general desktop use, most distros have a sane default. Average desktop use does not stress the system enough for the swapiness to be a significant factor in performance.

    Cheers, Nick
     
  6. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,713
    Location:
    George, S.Africa
    You might be 'rewarded' with seeing something swapped when you rip a DVD movie to mp4.
    :D
     
  7. Trespasser

    Trespasser Registered Member

    Joined:
    Mar 1, 2005
    Posts:
    1,204
    Location:
    Virginia - Appalachian Mtns
    Or mkv to DVD structure...not that I'm breaking any laws. :shifty: .

    Later...
     
  8. tlu

    tlu Guest

    While probably not relevant in your case, it might be useful to know that instead of a swap partition you can also use a swap file (similar to Windows) which can be created anywhere (e.g. on a second harddisk).
     
  9. malexous

    malexous Registered Member

    Joined:
    Jun 18, 2010
    Posts:
    830
    Location:
    Ireland
    It looks to me like you have no swap set up - 0 bytes of 0 bytes.
     
    Last edited: Jul 7, 2011
  10. tlu

    tlu Guest

    After looking again at aigle's picture it's obvious that you're absolutely right.:thumb:

    No swap -> no swap usage :D
     
  11. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    It,s very starnge. What about this swap partition?

    Thanks for all the people who replied.
     

    Attached Files:

  12. NGRhodes

    NGRhodes Registered Member

    Joined:
    Jun 23, 2003
    Posts:
    2,381
    Location:
    West Yorkshire, UK
    Is it in your fstab ?

    Cheers, Nick
     
  13. J_L

    J_L Registered Member

    Joined:
    Nov 6, 2009
    Posts:
    8,738
    My netbook has a SSD not hard drive.

    Just got swapd. How should I configure it for my 8 GB SD card? I use it for my download directory as well.
     
    Last edited: Jul 7, 2011
  14. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    ok, it,s like this. i can,t understand it fully by the way.

     
  15. J_L

    J_L Registered Member

    Joined:
    Nov 6, 2009
    Posts:
    8,738
    I'm using swapd, because it should save more space. Do you have settings for that?
     
  16. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    hmm.. wat is swapd?
     
  17. wilbertnl

    wilbertnl Registered Member

    Joined:
    Dec 29, 2004
    Posts:
    1,850
    Location:
    Tulsa, Oklahoma
    Aigle, try swapon -a
    and check with free
     
  18. J_L

    J_L Registered Member

    Joined:
    Nov 6, 2009
    Posts:
    8,738
    It is in the main repository. Google "swapd".
     
  19. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,713
    Location:
    George, S.Africa
    About swap faq's and making a swap file. Scroll to Four-step Process to Add Swap File.

    Four-step Process to Add Swap File

    I don't know whether swapd is the preferred solution.
     
  20. tlu

    tlu Guest

    I've never used swapd. But according to the manpage you should use the swapdir option in your swapd.conf file.
     
  21. rudyl

    rudyl Registered Member

    Joined:
    Jul 1, 2011
    Posts:
    30
    It's traditional to use swap partitions 100%-200% of total memory. Swap partitions are much faster than swapd, which needs to create swap files on the fly. Consider using swapd with a minimal swap partition.
     
  22. J_L

    J_L Registered Member

    Joined:
    Nov 6, 2009
    Posts:
    8,738
  23. rudyl

    rudyl Registered Member

    Joined:
    Jul 1, 2011
    Posts:
    30
    Yes, I see. Thanks. Old habits ;) I'll have to try some swapd.
     
  24. aigle

    aigle Registered Member

    Joined:
    Dec 14, 2005
    Posts:
    11,164
    Location:
    UK / Pakistan
    i get this

     
  25. jnthn

    jnthn Registered Member

    Joined:
    Sep 22, 2010
    Posts:
    185
    can swapd be used on a system that is hibernated? I read some documentation on ubuntu that the swap partition needs to be at least the same size as the ram installed for hibernation that's why I have a 3gig swap partition on a laptop.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.