Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: Too much swap being used

  1. #1
    Join Date
    Nov 2009
    Location
    Chennai, India
    Beans
    503
    Distro
    Ubuntu 11.04 Natty Narwhal

    Too much swap being used

    Hi all,

    (Note: I've already checked the forums and google but nothing seems to work hence this new thread)

    Problem:

    Way too much swap is being used although most of the RAM is free.

    What I've Tried:
    1. https://help.ubuntu.com/community/SwapFaq
    - Tried changing the vm.swappiness(the temporary solution that is lost on reboot),no use
    - The swap2ram.sh didn't work (gives the "not enough RAM" error although there is enough memory)

    Stats:
    uname -a:
    Code:
    Linux nits-desktop 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 05:23:09 UTC 2010 i686 GNU/Linux

    free -m:
    Code:
    nits@nits-desktop:/usr/sbin$ free -m
                 total       used       free     shared    buffers     cached
    Mem:          2003       1941         61          0         25       1476
    -/+ buffers/cache:        439       1563
    Swap:         2548       1033       1514
    cat /proc/sys/vm/swappiness
    Code:
    nits@nits-desktop:/usr/sbin$ cat /proc/sys/vm/swappiness
    10
    cat /proc/swaps
    Code:
    nits@nits-desktop:/usr/sbin$ cat /proc/swaps
    Filename                Type        Size    Used    Priority
    /dev/ramzswap0                          partition    512792    488768    100
    /dev/sda6                               partition    2096440    569832    -1
    error while executing swap2ram.sh:
    Code:
    nits@nits-desktop:/usr/sbin$ sudo swap2ram.sh
    -e not enough RAM to write swap back, nothing done
    More than happy to provide you with whatever more info required. Please do help. Thanks. Cheers!
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  2. #2
    Join Date
    Nov 2009
    Location
    Chennai, India
    Beans
    503
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Too much swap being used

    Sorry folks, just got my head outta my a** and noticed that a lot of memory was being cached. but still isn't this high swap usage???
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  3. #3
    Join Date
    Jan 2008
    Beans
    4,757

    Re: Too much swap being used

    How long have you been logged in / system uptime?
    Code:
    date; who; uptime
    Does dropping caches help?
    Code:
    free -m
    sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
    free -m
    free -m will take a note of memory usage before and after the command.

    Regards
    Iain
    Last edited by ibuclaw; May 9th, 2010 at 02:43 PM.

  4. #4
    Join Date
    Nov 2009
    Location
    Chennai, India
    Beans
    503
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Too much swap being used

    Quote Originally Posted by ibuclaw View Post
    How long have you been logged in / system uptime?

    Code:
    date; who; uptime
    Code:
    Sun May  9 19:11:02 IST 2010
    nits     tty7         2010-05-09 08:45 (:0)
    nits     pts/0        2010-05-09 12:38 (:0.0)
    nits     pts/1        2010-05-09 19:10 (:0.0)
     19:11:02 up 10:25,  3 users,  load average: 0.07, 0.02, 0.00
    I have run the system for 4 days and all earlier( that was the longest before there was a power-cut) but it was running pretty ok with just very very little swap being used.

    Does dropping caches help?
    Code:
    free -m
    sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
    free -m
    I don't think so...
    Code:
    nits@nits-desktop:~$ free -m 
                 total       used       free     shared    buffers     cached
    Mem:          2003       1937         66          0         27       1435
    -/+ buffers/cache:        473       1529
    Swap:         2548       1033       1514
    nits@nits-desktop:~$ sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
    [sudo] password for nits: 
    3
    nits@nits-desktop:~$ free -m
                 total       used       free     shared    buffers     cached
    Mem:          2003        728       1274          0          1        265
    -/+ buffers/cache:        461       1541
    Swap:         2548       1033       1514
    Last edited by nitstorm; May 9th, 2010 at 02:57 PM.
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  5. #5
    Join Date
    Nov 2009
    Beans
    Hidden!
    Distro
    Kubuntu 10.10 Maverick Meerkat

    Re: Too much swap being used

    Turn off swapping on ramzswap0 device (swapoff /dev/ramzwap0) and see if it is any better since you already have a 2GB RAM.

  6. #6
    Join Date
    Nov 2009
    Location
    Chennai, India
    Beans
    503
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Too much swap being used

    Quote Originally Posted by john newbuntu View Post
    Turn off swapping on ramzswap0 device (swapoff /dev/ramzwap0) and see if it is any better since you already have a 2GB RAM.
    Code:
    nits@nits-desktop:~$ sudo swapoff /dev/ramzwap0
    [sudo] password for nits: 
    swapoff: /dev/ramzwap0: swapoff failed: No such file or directory
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  7. #7
    Join Date
    Jan 2008
    Beans
    4,757

    Re: Too much swap being used

    Quote Originally Posted by nitstorm View Post
    i don't think so...
    Code:
    nits@nits-desktop:~$ free -m 
                 total       used       free     shared    buffers     cached
    mem:          2003       1937         66          0         27       1435
    -/+ buffers/cache:        473       1529
    swap:         2548       1033       1514
    nits@nits-desktop:~$ sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
    [sudo] password for nits: 
    3
    nits@nits-desktop:~$ free -m
                 total       used       free     shared    buffers     cached
    mem:          2003        728       1274          0          1        265
    -/+ buffers/cache:        461       1541
    swap:         2548       1033       1514
    Highlighted important bits.

    Looks like it free'd up caches successfully.
    You should now be able to turn swap off and back on again to move it back into memory.

    Code:
    sudo swapoff -a
    sudo swapon -a
    Now that is the workaround sorted.

    As for the real questions... What applications do you use most?
    Something is eating your system cache significantly for you to run that low on memory...

  8. #8
    Join Date
    Nov 2009
    Location
    Chennai, India
    Beans
    503
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Too much swap being used

    Thanks ibuclaw , that worked

    I somehow expected it to magically move the applications from swap to RAM once the cache was cleared, LOL. Also gonna run it for around 12 or so hours just in case the swap starts acting funny again. If the problem doesn't arise will mark the thread solved then. Hope that's ok..

    My frequently used programs are :
    1. Firefox( I keep watching videos freaking most of the time)
    2. quodlibet
    3. vlc
    4. rtorrent
    5. conky
    6. cairo-dock

    here is a top just in case:
    Code:
    top - 22:21:32 up 13:36,  3 users,  load average: 0.01, 0.31, 0.42
    Tasks: 155 total,   2 running, 153 sleeping,   0 stopped,   0 zombie
    Cpu(s):  7.9%us,  2.5%sy,  0.0%ni, 88.7%id,  0.8%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   2051192k total,  1982556k used,    68636k free,     9612k buffers
    Swap:  2096440k total,     1152k used,  2095288k free,  1404180k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
     7617 nits      20   0  484m 126m  37m S   39  6.3  17:44.29 firefox ##(watching a video )           
      995 root      20   0 75284  21m  10m S    6  1.1  17:18.97 Xorg               
     1624 nits      20   0 14476 2084 1092 S    2  0.1   4:22.27 conky              
    10449 nits      20   0  2468 1068  784 R    2  0.1   0:00.01 top                
        1 root      20   0  2508 1148  788 S    0  0.1   0:00.87 init               
        2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd           
        3 root      RT  -5     0    0    0 S    0  0.0   0:00.00 migration/0        
        4 root      15  -5     0    0    0 S    0  0.0   0:00.28 ksoftirqd/0        
        5 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/0         
        6 root      RT  -5     0    0    0 S    0  0.0   0:00.00 migration/1        
        7 root      15  -5     0    0    0 S    0  0.0   0:00.51 ksoftirqd/1        
        8 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/1         
        9 root      15  -5     0    0    0 S    0  0.0   0:00.20 events/0           
       10 root      15  -5     0    0    0 S    0  0.0   0:00.46 events/1           
       11 root      15  -5     0    0    0 S    0  0.0   0:00.00 cpuset             
       12 root      15  -5     0    0    0 S    0  0.0   0:00.00 khelper            
       13 root      15  -5     0    0    0 S    0  0.0   0:00.00 netns
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  9. #9
    Join Date
    Jul 2008
    Location
    North Carolina
    Beans
    478
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Too much swap being used

    Have you been using Lucid since the betas? I had the same issue which turned out to be an Xorg memory leak. I had to add the Xboot PPA to my sources and run `apt-get dist-upgrade` which installed a testing version that fixed the issue.

    I believe this was the bug report:

    Bug #565981
    Good judgment comes from experience, and often experience comes from bad judgment.

  10. #10
    Join Date
    Nov 2009
    Location
    Chennai, India
    Beans
    503
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Too much swap being used

    Quote Originally Posted by itsjareds View Post
    Have you been using Lucid since the betas? I had the same issue which turned out to be an Xorg memory leak. I had to add the Xboot PPA to my sources and run `apt-get dist-upgrade` which installed a testing version that fixed the issue.

    I believe this was the bug report:

    Bug #565981
    Nope. Using Karmic. I dual boot with a Lucid Beta 2 though, but I don't think that's the problem right? Also I never saw Xorg in my top this often before a couple of days, that's when this started. Today it just grew too big and so I decided to post here.
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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