Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 40

Thread: Too much swap being used

  1. #21
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Too much swap being used

    Quote Originally Posted by lavinog View Post
    https://bugs.launchpad.net/ubuntu/+s...y/+bug/328437/
    It looks like installing remastersys might be causing this issue.
    good point

    new uptodated remastersys:

    echo "deb http://www.geekconnection.org/remastersys/repository ubuntu/" | sudo tee -a /etc/apt/sources.list
    sudo apt-get update
    sudo apt-get install remastersys
    Last edited by dino99; May 10th, 2010 at 09:20 AM.

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

    Re: Too much swap being used

    ramzswap appears to be "A RAM based block device which acts as a swap disk. Pages swapped to this disk are compressed and stored in memory itself." (Thanks to Google). Here's a link from another forum on how it can be removed(see post 13):
    http://crunchbanglinux.org/forums/to...-of-swap-file/

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

    Talking Re: Too much swap being used

    Quote Originally Posted by lavinog View Post
    I was looking at that exact thread actually Post #9 solved it so for future reference i am posting the link to that single post here. http://ubuntuforums.org/showpost.php...39&postcount=9
    So, that removed ramzswap0 after the reboot.

    It looks like installing remastersys might be causing this issue.
    Dang!!! I do have remastersys installed!!!

    Thanks a lot everyone, but still gonna wait a while before I mark the thread solved. Cheers!
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  4. #24
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Too much swap being used

    look back to post #17 (updated) before reboot

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

    Re: Too much swap being used

    look back to post #17 (updated) before reboot
    Shoot I missed that then I guess, but ramzswap0 is gone. Already ran the update-initramfs -u -k 'uname -r' so should I run the dpkg --configure -a now?? I am confused.

    Also after the reboot everything was fine for a few minutes and then the swap started filling up like crazy. And I thought I'd let the system run for a while, see if that sorted the problem out, but it hasn't. The swap usage has pretty much been the same since it spiked suddenly.( if this is important there was some program called collector that was on the top of the chart in top when the swap usage was spiking, i ran which collector returned nothing, ran locate collector which returned /lib/bootchart/collector, got three other returns but they had the word collector in them, this was the only thing that had just the word collector in it)

    here are my stats now:
    sudo swapon -s:
    Code:
    Filename                Type        Size    Used    Priority
    /dev/sda6                               partition    2096440    636240    -1
    free -m:
    Code:
                 total       used       free     shared    buffers     cached
    Mem:          2003       1941         61          0         27       1681
    -/+ buffers/cache:        232       1770
    Swap:         2047        621       1425
    Wondering if I should keep clearing the cache everytime swap usage spikes? Would that be the proper solution to this? Or is a re-install the ultimate answer?

    Damn!! Talking way too much, gonna shut up now and thanks for the help guys(for uptil now and in advance...)
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  6. #26
    Join Date
    Jun 2006
    Beans
    2,930

    Re: Too much swap being used

    you can use this to show the full path names
    Code:
    ps auxf|less
    Support 7z in default installs!!!: Click Here

    How to use code blocks to post command output: Click Here
    Official Ubuntu Documentation

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

    Smile Re: Too much swap being used

    Just updated to Lucid Lynx yesterday and I don't seem to have the memory leak problem so far, I've just let the machine run for a few hours like 4 or 5 hours at a stretch due to the very frequent power outages we have here but during that time no mem leaks. I still do sudo sysctl vm.swappiness=0 every time I boot,just in case. lolz

    Anyways thanks a lot for the help guys. Gonna mark this thread solved I guess. Cheers!
    I like to keep it respectful with OpenRespect
    I write at The Void Ghost and 2buntu

  8. #28
    Join Date
    Oct 2007
    Beans
    94

    Re: Too much swap being used

    Hi there, I have a somewhat related problem:

    I have 4GB ram installed, due to onboard graphic card I do not have it all available:

    Code:
    free -m
                 total       used       free     shared    buffers     cached
    Mem:          3388       2789        599          0         54        853
    -/+ buffers/cache:       1881       1507
    Swap:         5857          0       5857
    .

    Anyhow, no matter how much RAM i put inside, I always end up swapping, since I really use that device

    So I thought about an automation to write back swap.. I thought about wirting a modification of swap2ram from https://help.ubuntu.com/community/SwapFaq#Empty%20Swap and making it repetetive via "sudo crontab -e"

    Code:
    #!/bin/sh
    err="not enough RAM to write swap back, nothing done"
    mem=`free|grep Mem:|awk '{print $4}'`
    swap=`free|grep Swap:|awk '{print $3}'`
    log="/home/user/.custom.log"
    echo "`date`"" : Checking swap state" >> $log
    test $mem -lt $swap && sync
    sleep 1
    test $mem -lt $swap && echo -e $err >> $log; touch /home/user/.swap_warning && exit 1
    swapoff -a && swapon -a && rm /home/user/.swap_warning; exit 0
    I thought it would be nice to keep a history in "/home/user/.custom.log" and a warning file in "/.swap_warning", that i could monitor lets say via another cron job that notifies me when I reached the limit ("notify-send 'Close those windows!'" .

    So what do you think: is there an easier / existing solution??

  9. #29
    Join Date
    Dec 2010
    Beans
    549

    Re: Too much swap being used

    Having a swap file is not a problem. No reason not to, and several reasons why it might be a good idea. Don't just disable a swap file because some google jockey read an article from the last century and thinks it is a bad idea. The only really good reason I can think of for having a swap partition these days is to share it between different Linux installations on the same machine rather than having a 2GB file sitting on every one of them. Swap files are much more flexible and perform just as well.

    Same with compcache (ramzswap). It is generally quite a useful form of swap even if you don't understand exactly what it does. Exactly what it does is compress pages that would otherwise be swapped out to your hard drive and then writes them into memory. This means that when you need to read pages back from swap they are available relatively quickly instead of extremely slowly from a hard drive. Any significant number of reads from swap on a hard drive absolutely kills your system, while compcache allows it to continue at usable speeds. This allows you to run with a quite aggressive swappiness setting without the risk of over-swapping and killing your system. Overall performance should improve in most situations. The downside is that by definition your memory is full when pages are being written to swap, so writing even more stuff into memory tends to increase the amount of swap used quite quickly. The default settings of compcache at 15% of your RAM means that less than 10% of RAM will ever be used for those compressed pages. Compcache reports the uncompressed swap size which can look quite scary of you think it is taking that much memory, but the compression ratio is typically near 4:1. In practice this means a gradual decrease in performance as swap is used rather than hitting a brick wall. I suggest you enable it again, and with 2GB of memory perhaps even increase the size to 30% or 40%. And try not to be scared when your system is always showing 100MB of swap or more, it is a good thing.

  10. #30
    Join Date
    Dec 2010
    Beans
    549

    Re: Too much swap being used

    Anyhow, no matter how much RAM i put inside, I always end up swapping
    It's intentional! Don't try to rewrite Linux because you think swap is a bad idea. Linux will always use all your RAM after a certain amount of time. It is designed to cache all your disk activity and sooner or later that means all your memory will be in use. Then it will start to swap out pages it thinks are unused and it is quite heavily slanted towards swapping out application memory. Within reason this works well because most applications have a chunk of memory that they never use or only use once at startup, so you just don't need that. The disk cache pages will be clawed back whenever an application needs more memory so they never hurt you. The only pain comes when so many pages get swapped out that you actually need some of them. Getting them back from disk is deathly slow and you will know when it happens. Only then should you worry.

    I very much doubt that your memory card has anything to do with this. Graphics memory use for normal 2D desktop activities is maybe 4MB. Maybe you have a huge virtual desktop or several wokspaces? I'll give you 20MB. Maybe you are using a brand new browser with hardware acceleration, so perhaps doublt that. It is nothing compared to your 4GB. Only major 3D gaming will use big chunks of memory and typically graphics cards sharing system memory are just too slow for you to want to use hundreds of MB of it.

Page 3 of 4 FirstFirst 1234 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
  •