Announcement

Collapse
No announcement yet.

64 bit ram usage and swapping

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    64 bit ram usage and swapping

    Hello I have recently installed 64 bit kubuntu and am now experiencing alot of slowness. I have 2 gigs of ram and have found that my computer is doing alot of swapping. I have been really monitoring my computer trying to fix this problem and do not see the cause for the swapping. I am not running many programs at all just a filebrowser console skype and firefox and rtorrent mainly.

    None of my process's seem heavy yet my rams full most the time. I understand ram being full is a good thing but its swapping out. To speed things up I have wrote a script that clears my ram and swap as its like refreshing my computer then it seems to be fast for awhile.

    When I run sudo su -c "sync; echo 3 > /proc/sys/vm/drop_caches" immediatly my computer drops to about 500mb of ram usage and then no swapping occurs for awhile.

    Is it possible something is just not releasing my ram after usage or something has just gone wrong? Or do I need more ram?

    I have used 32bit linux for a long time and have never been concerned about my ram usage. I am now using saidar and every 15 minutes dumping a top output to a file so I can analyze and I still dont see anything suspicious its just a casual grow and grow. If 64bit really needs more ram I will just have to buy more but it just seems strange. Suprisingly I have not been able to find much info on ram recommendations for 64 bit.

    Another strange thing is kde's system monitor is way off what terminal apps like saidar and top are telling me I have. It is usually around half the amount difference.


    Thanks for any input on this.





    #2
    Re: 64 bit ram usage and swapping

    I am running 64 bit with 4 gig, but I am sure 2gig should be more than enough (the incremental need for 64 bit is not a factor two, and even if it was, 1gig is more than enought in 32 bit, actually 512 is just fine).

    Have you tried, for a start, "kdesudo kate /etc/fstab", and comment out the swap partition and a reboot? It would be nice to see what happens with no swap partition, the ram should be more than enough.

    Is this an upgrade or fresh jaunty install? Is your system up to date?

    This really seems like a serious memory leak. I am actually also seeing a leak, I think, in my eeepc, jaunty, kde4.3, with 1gb of ram. If I play, say, youtube or any flash videos for a long time, and/or stay logged in long enough, the system becomes unresponsive at some point. Loging out and in releases the memory it seems (typical of a mem leak).

    Incidentally, for anyone technical, I was surprised KDE uses naked pointers so much (while browsing some code for a bugfix), when there is the QPointer smart pointer (and any reference counting smart pointer like boost::shared_ptr would eliminate all the leaks, plus some crashes: QPointer can be deleted twice.

    Comment


      #3
      Re: 64 bit ram usage and swapping

      Originally posted by easoukenka
      Hello I have recently installed 64 bit kubuntu and am now experiencing alot of slowness. I have 2 gigs of ram and have found that my computer is doing alot of swapping. I have been really monitoring my computer trying to fix this problem and do not see the cause for the swapping. I am not running many programs at all just a filebrowser console skype and firefox and rtorrent mainly.

      Something is definitely wrong -- 2G of memory is fine for normal (casual) use, and there should be no swapping. A little help could be from here:

      http://rudd-o.com/en/linux-and-free-...ow-to-fix-that

      But your system should not need such tweaks.

      I would not trust the KDE monitor at this point -- you need to use top and htop and find out what in the world is using so much memory.

      I have recently confirmed that plasma-desktop appears to have a memory leak, but it takes days to become a serious problem, at least on my rig. So, if you boot your system and browse and play some music and it is swapping within a few hours, something is definitely wrong.

      How large is the partition where you installed Kubuntu? How large is the swap space that is being used? Have you made any special changes to the default system configuration, after you installed it? Did the 64-bit Live CD run without problems on your hardware?

      What about your video setup -- what is your graphics chip and what driver are you using?

      I'd like to know the output of these commands in the konsole:

      Code:
      cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      
      cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

      Comment


        #4
        Re: 64 bit ram usage and swapping

        Originally posted by lmilano
        I am running 64 bit with 4 gig, but I am sure 2gig should be more than enough (the incremental need for 64 bit is not a factor two, and even if it was, 1gig is more than enought in 32 bit, actually 512 is just fine).

        Have you tried, for a start, "kdesudo kate /etc/fstab", and comment out the swap partition and a reboot? It would be nice to see what happens with no swap partition, the ram should be more than enough.

        Is this an upgrade or fresh jaunty install? Is your system up to date?

        This really seems like a serious memory leak. I am actually also seeing a leak, I think, in my eeepc, jaunty, kde4.3, with 1gb of ram. If I play, say, youtube or any flash videos for a long time, and/or stay logged in long enough, the system becomes unresponsive at some point. Loging out and in releases the memory it seems (typical of a mem leak).

        Incidentally, for anyone technical, I was surprised KDE uses naked pointers so much (while browsing some code for a bugfix), when there is the QPointer smart pointer (and any reference counting smart pointer like boost::shared_ptr would eliminate all the leaks, plus some crashes: QPointer can be deleted twice.
        Indeed.
        http://doc.trolltech.com/4.5/qpointer.html

        Detailed Description


        The QPointer class is a template class that provides guarded pointers to QObjects.

        A guarded pointer, QPointer<T>, behaves like a normal C++ pointer T *, except that it is automatically set to 0 when the referenced object is destroyed (unlike normal C++ pointers, which become "dangling pointers" in such cases). T must be a subclass of QObject.

        Guarded pointers are useful whenever you need to store a pointer to a QObject that is owned by someone else, and therefore might be destroyed while you still hold a reference to it. You can safely test the pointer for validity.

        Qt also provides QSharedPointer, an implementation of a reference-counted shared pointer object, which can be used to maintain a collection of references to an individual pointer.

        Example:

        Code:
           
        QPointer<QLabel> label = new QLabel;
           label->setText("&Status:");
           ...
           if (label)
             label->show();
        If the QLabel is deleted in the meantime, the label variable will hold 0 instead of an invalid address, and the last line will never be executed.

        The functions and operators available with a QPointer are the same as those available with a normal unguarded pointer, except the pointer arithmetic operators (+, -, ++, and --), which are normally used only with arrays of objects.

        Use QPointers like normal pointers and you will not need to read this class documentation.

        For creating guarded pointers, you can construct or assign to them from a T* or from another guarded pointer of the same type. You can compare them with each other using operator==() and operator!=(), or test for 0 with isNull(). You can dereference them using either the *x or the x->member notation.

        A guarded pointer will automatically cast to a T *, so you can freely mix guarded and unguarded pointers. This means that if you have a QPointer<QWidget>, you can pass it to a function that requires a QWidget *. For this reason, it is of little value to declare functions to take a QPointer as a parameter; just use normal pointers. Use a QPointer when you are storing a pointer over time.

        Note that class T must inherit QObject, or a compilation or link error will result.

        See also QSharedPointer, QObject, and QObjectCleanupHandler.
        I suspect that the programmer is abusing the smart pointer but I am surprised that the compiler didn't pick it up.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Re: 64 bit ram usage and swapping

          I was experiencing similar problems. 64 bit, 4 gb mem. While trying dfferent things to identify the problem, I turned off the ATD and Anacron service. Don't know what they were running, but my computer is much faster now. You might also look at this page about swappiness.

          https://help.ubuntu.com/community/SwapFaq

          Comment


            #6
            Re: 64 bit ram usage and swapping

            Ah, now that you mention it, I also had issues with anacron and cron on my eeepc. They were installed, and once I noticed at boot time that the service cron (or was it anacron?) was being started and stopped all the time, so I uninstalled both.

            However, I do use atd and cron on the desktop, the amd64 I mentioned above, which is running fine, I could check there whether anacron is also installed ...

            Comment


              #7
              Re: 64 bit ram usage and swapping

              FYI:

              Last nite I installed the 08-20-09 snapshot of the 64bit Karmic to a 40 GB second partition of my HD.

              I have 3GB of RAM

              I have had Karmic on a total of 3 hr and 25 min. The memory usage has stayed at a steady around 0.6GB +- 0.1 GB
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                Re: 64 bit ram usage and swapping

                Thank you for all the responses. Unfortunetly I dont have much time to test everything but I did install htop looks like a really nice program to help me figure this out.

                I have the kubuntu 64bit 9.04 fresh install and fully up to date. Linux asoukenka 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 01:19:55 UTC 2009 x86_64 GNU/Linux

                This morning I when I woke up pc was very unresponsive i made it to terminal and ran my clearswap and clearram commands. As I mentioned I have a top dump every 15 minutes so I can observe this is a snippet from before I woke up I run rtorrent at night:

                Cpu(s): 46.0%us, 5.0%sy, 0.1%ni, 47.9%id, 0.7%wa, 0.1%hi, 0.2%si, 0.0%st
                Mem: 2033868k total, 2015108k used, 18760k free, 7916k buffers
                Swap: 2047992k total, 427716k used, 1620276k free, 1382560k cached

                PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
                3928 root 20 0 304m 71m 1876 R 29 3.6 147:53.52 Xorg
                19089 asoukenk 20 0 246m 9292 3040 S 27 0.5 77:38.41 krunner_lock
                19121 asoukenk 20 0 182m 9292 3040 S 23 0.5 82:09.27 krunner_lock
                19106 asoukenk 20 0 182m 9228 3040 R 14 0.5 77:50.96 krunner_lock
                4484 asoukenk 20 0 774m 122m 4252 S 6 6.2 23:11.18 plasma
                19775 asoukenk 20 0 359m 158m 85m S 4 8.0 5:35.99 rtorrent
                13017 asoukenk 20 0 10640 988 608 S 2 0.0 8:32.14 saidar
                1 root 20 0 10456 144 116 S 0 0.0 0:00.80 init


                Awhile ago I disabled all desktop effects and shut down many services and running programs trying to narrow this down.

                As mentioned about disabling the swap I have done this but without modifying fstab by using this command which maybe others will find helpful to clear swap:

                sudo su -c "swapoff /dev/sdb3; swapon /dev/sdb3"

                I didnt leave it with no swap for long as it made me nervous but I will definetly try this more

                I run this and the previous command I mentioned to clear ram to refresh my system without relogging in or rebooting. Kind of freshens me up for a little while

                I tryed the commands posted by dibl but file did not exist. I ran a locate to see if I could find it in another location but no luck.

                I have 2gb swap...

                Hope I answered all questions I will keep this post updated and try recommended links. I also am going to install a gnome desktop see what happens.

                Comment


                  #9
                  Re: 64 bit ram usage and swapping

                  Are you sure you have all the updates? For some reason I have the -15 kernel

                  Linux grisell 2.6.28-15-server #49-Ubuntu SMP

                  Also, I use the server kernel, because I have more than 3 Gb. swapoff is a better idea, yes. There is no harm keeping it off, you may get a crash instead of a sluggish system writing to disk, but you should be fine after reboot.

                  I would do "df -h" to check disk usage, and also monitor the kernel messages for a while: "tail -f /var/log/messages".

                  Comment


                    #10
                    Re: 64 bit ram usage and swapping

                    Originally posted by easoukenka

                    19775 asoukenk 20 0 359m 158m 85m S 4 8.0 5:35.99 rtorrent
                    There's a possible clue.

                    As a part of the troubleshooting process, it would be interesting to know how your system behaves with no xorg and no rtorrent running. Just boot it, Ctrl-Alt-F1 to the console, issue
                    Code:
                    sudo /etc/init.d/kdm stop
                    and (as user)
                    Code:
                    killall rtorrent
                    . Let it run for awhile and then check htop and see what the swapping situation is.

                    Also, I'm still curious to know how large the partition is where you installed Kubuntu, and how much free space is on it now (lmilano is curious about the same thing ).

                    Comment


                      #11
                      Re: 64 bit ram usage and swapping

                      I am now in gnome instead of KDE and still is doing some swapping. I have also looked over logs and have not seen anything that stands out. I will however look further into this as recommended.

                      I am running rtorrent automatically on and off with my screensaver ( can provide script if you want it is really cool! ) Based on feedback and Ideas I have now switched to gnome where this problem still appears to exist so the next step is to disable my swap which I have now done.

                      One thing I think should really be looked into but I have no idea what to do is as stated before kde system monitor reports my ram differently then Top and free commands. Also as recommended I am using htop which also shows the same number as kde system monitor?!

                      In this screenshot you can see htop and the gui monitor showing 528mb used out of 2gigs while the other programs are showing it full. Maybe some apps are reading the wrong number and causing my computer to swap out?

                      http://soukenka.com/snapshot1.png



                      Disk usage seems fine:
                      Filesystem Size Used Avail Use% Mounted on
                      /dev/sdb6 9.7G 5.4G 3.8G 59% /
                      tmpfs 994M 0 994M 0% /lib/init/rw
                      varrun 994M 224K 993M 1% /var/run
                      varlock 994M 0 994M 0% /var/lock
                      udev 994M 196K 993M 1% /dev
                      tmpfs 994M 0 994M 0% /dev/shm
                      lrm 994M 2.5M 991M 1% /lib/modules/2.6.28-15-generic/volatile
                      /dev/sdb1 194M 46M 138M 25% /boot
                      /dev/sdb5 481G 182G 276G 40% /home
                      /dev/sda1 917G 572G 300G 66% /media/bigmambajamba
                      /dev/sdb7 87G 28G 60G 32% /media/vista
                      /dev/sdc1 230G 182G 36G 84% /media/kahuna
                      /dev/sdb2 9.7G 3.4G 6.2G 35% /media/root_bck
                      /dev/sr0 236M 236M 0 100% /media/cdrom1


                      Thank you for all the help!

                      Comment


                        #12
                        Re: 64 bit ram usage and swapping

                        You have 6 instances of Firefox running, each one using 5% of memory.

                        Comment


                          #13
                          Re: 64 bit ram usage and swapping

                          I have never used htop before and for some reason it does that with most my programs. Top and ps only return one instance I do not know much about htop but just assumed it worked in some geek way I do not know about

                          Right now it shows 10 mysqld's too haha.


                          Comment


                            #14
                            Re: 64 bit ram usage and swapping

                            Each instance has a different PID number, so I would assume they are real. That might explain the massive memory usage, although it's not obvious why you would have so many instances of the same application running.

                            Did you ever try
                            Code:
                            killall firefox-bin
                            and the same thing with mysql?

                            Comment


                              #15
                              Re: 64 bit ram usage and swapping

                              Could it be session management gone wrong?

                              In the System Settings you might want to try going to the Advanced tab, then to the Session Manager, and choosing "Start with an empty session" to make sure programs aren't being run multiple times each time you restart. However, your symptoms aren't really supposed to occur due to sessions being saved.

                              Comment

                              Working...
                              X