Announcement

Collapse
No announcement yet.

Why does Kubuntu use so much memory?

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

    Why does Kubuntu use so much memory?

    I boot Kubuntu 6.06 "Dapper" and open one window of Konqueror and one of Konsole. Then, I type in the command free and I get:

    Mem: total: 515952 used: 458224 free: 57628

    I am on a laptop with 512 MB of DDR2 SDRAM. My WinXP only uses about a quarter of the memory. Kubuntu uses a lot more. The only other processes that I set to startup on boot are KLaptop and KNetworkManager. I don't want to have to go run Xfce for use as my Linux desktop environment mainstay. My laptop is only almost a year old and was among the high-end models, too.

    #2
    Re: Why does Kubuntu use so much memory?

    I would say i have similar issues with memory. As to why -- simple, there are a lot of things running. If you hit Ctrl+Esc, you will get a task manager similar to xp's task manager. You will see a massive number of things running -- these are programs that maintain various (often, in my experience, minor or unnecessary) components of the system.

    I'm not an expert, frankly, i'm just over a noob myself (but i find it to be my duty as a person using this forum to contribute to it as well, so i'm glad to tell you what i know ). I couldn't tell you what each of the things does (yet). But i can point you to http://www.google.com/linux (been my buddy since i finally tossed windows out the window ), your local man pages, and /usr/local/doc/ on your hard drive for plenty of information.

    You might also install apt-file and search your packages for those names in the processtable. I have found this an effective way to find out what package they are in.
    Code:
    *install apt-file (searches the files in packages much like adept searches for packages)
    sudo apt-get install apt-file
    
    *make sure you update apt-file (like you have to fetch updates for apt-get :))
    sudo apt-file update
    
    *use apt-file to search for acpid (a process in my table)
    sudo apt-file list acpid
    sudo apt-file show acpid 
    *(both of those do the same thing.)
    
    *Should return the following:
    acpid: etc/acpi/events/powerbtn
    acpid: etc/acpi/powerbtn.sh
    acpid: etc/default/acpid
    acpid: etc/init.d/acpid
    acpid: etc/logrotate.d/acpid
    acpid: etc/mkinitrd/scripts/acpid
    acpid: usr/bin/acpi_listen
    acpid: usr/sbin/acpid
    acpid: usr/share/doc/acpid/README.gz
    acpid: usr/share/doc/acpid/changelog.Debian.gz
    acpid: usr/share/doc/acpid/changelog.gz
    acpid: usr/share/doc/acpid/copyright
    acpid: usr/share/doc/acpid/examples/ac.gz
    acpid: usr/share/doc/acpid/examples/ac.sh.gz
    acpid: usr/share/doc/acpid/examples/default.gz
    acpid: usr/share/doc/acpid/examples/default.sh.gz
    acpid: usr/share/man/man8/acpi_listen.8.gz
    acpid: usr/share/man/man8/acpid.8.gz
    acpidump: usr/bin/acpidump
    acpidump: usr/bin/acpitbl
    acpidump: usr/bin/acpixtract
    acpidump: usr/share/doc/acpidump/README
    acpidump: usr/share/doc/acpidump/changelog.Debian.gz
    acpidump: usr/share/doc/acpidump/copyright
    acpidump: usr/share/man/man1/acpidump.1.gz
    acpidump: usr/share/man/man1/acpitbl.1.gz
    acpidump: usr/share/man/man1/acpixtract.1.gz
    
    
    *which might be grotesque at first, but it's simple: 
    packagename: path/file
    *packagename is the name of the package which contained the file. The file is then listed with the path it would be in after an install.

    A word of warning, from experience having had to rebuild my system from almost the ground up (or at least the KDE part...): CHECK DEPENDENCIES BEFORE YOU REMOVE SOMETHING!!! If you remove something that is actually a core component of the system thinking it isn't doing much, you can inadvertently uninstall almost every package on the system. Done it. it hurts. Just check dependencies, and if you know without a shadow of a doubt that you don't need it for anything, you can force it by manually uninstalling it from dpkg (not going to explain how here because it's stupid if you don't know what you're doing. I've messed my systems up numerous times doing just that )

    Hope it helps!!

    Comment


      #3
      Re: Why does Kubuntu use so much memory?

      Yes, you are right. Linux, at least Kubuntu here, does have a lot of things going on at once. When I am running WinXP (my laptop is dual-booting) I have only 45 processes running right after booting. On Kubuntu, I have over 90 processes running after booting. With one instance each of Konqueror, Konsole, and KSysGuard, I have 100 processes running.

      Also, I notice that WinXP uses its pagefile all the time, keeping its physical memory usage rather low. Linux starts using its swap file when its system's memory is about to reach its limit. I am not saying which of the two is better since I am not qualified to make that kind of judgement.

      Since I didn't invest in Bluetooth connectivity at the time of purchase of my laptop, I figured I should remove the packages controlling Bluetooth adapters, connections, etc. I saw kdm print its launch to the screen during bootup. I did that, installed karamba, which "froze" my system (that wasn't supposed to happen under Linux! *gasp*) and had to cut off the power. Later, I removed karamba, something weird happened, launched KsysGuard and found x.org using 99% of the CPU. I didn't know what I could do, so I killed x.org and I was automatically brought back to the login screen. Ever since, my Kubuntu has been "broken". I am typing this using Kubuntu, but its pretty unstable right now (moreso than my WinXP).

      Kubuntu was a great introductory experience for me to the world of linux. But now that its unstable, I'll replace it to try out another distro. I think I will try out Slackware next, get some hard experience, avoid the bloat of "modern" linux distros, and get down and dirty with the command line.

      Comment


        #4
        Re: Why does Kubuntu use so much memory?

        Hi,

        Nice rant but you're wrong 

        A good part of the available physical memory is used as cache for hard disks and other block devices.  

        More infos: http://forums.gentoo.org/viewtopic.php?t=175419

        I notice that WinXP uses its pagefile all the time

        Tip: use qps instead of kysysguard.

        Comment


          #5
          Re: Why does Kubuntu use so much memory?

          Originally posted by Alienkind
          Kubuntu was a great introductory experience for me to the world of linux. But now that its unstable, I'll replace it to try out another distro. I think I will try out Slackware next, get some hard experience, avoid the bloat of "modern" linux distros, and get down and dirty with the command line.
          Sorry, maybe i'm too new, but what do you mean when you say "avoid the bloat of 'modern' linux distros"? You mean you don't want a GUI at all?

          Comment


            #6
            Re: Why does Kubuntu use so much memory?

            Err... I guess you should probably read the link caserio gave (thanks for that link) before going of to any other distro, because you will encounter the same behavior (except for the Bluetooth thing).

            Short answer: Linux handles memory differently from Windows.

            A bit longer answer: Linux and WIndows use different memory management models. WIndows only uses up the RAM that it currently needs, leaving up free spaces in your RAM.

            Linux, on the other hand, makes use of this free space for disk cache, speeding up read/write from/to files. You see, reading/writing from/to the Hard disk is significantly slower than reading/writing from/to RAM. So Linux uses this disk cache to temporarily boost performance. However, once more RAM is actually needed by applications, the kernel will automatically reduce the amount of disk cache in order to make room for the application's needs. Once that application no longer needs the memory it used, then it is freed and added once more to the disk cache. So think of your RAM as having to dynamically sizing parts: Application Data and Disk Cache. You can observe their sort of "dance" when you open KInfoCenter (K Menu > System) and going to the Memory options.

            Page files are the Windows counterpart Swap. The basic usage of Swap is to provide a sort of "emergency RAM" when your real, physical RAM can no longer accommodate your system's needs. However, since it is a partition/file on your hard disk, it is slower in performance compared to physical RAM. But, then again, once your system starts to need/use the swap/pagefile, then you really don't have much of a choice.

            Between Windows and Linux, which has the better memory management? I'll let you decide, but think about this: RAM's main function is to provide an area where data/instructions are to be stored for fast and easy access. Fast and easy access to thesee means a fast system. So you use/buy RAM in order to make your system perform better. Hard disks are used for storage. Period. The only role they play in performance is when RAM can no longer handle its load, and begins using the swap.

            So next time you see Windows using only a portion of your RAM, or Linux using up almost all of your RAM, think about the purpose of RAM and how much is or is not utilized to fulfill that purpose.
            Jucato's Data Core

            Comment


              #7
              Re: Why does Kubuntu use so much memory?

              Yup...old cliche:
              "Unused memory is unneeded memory"

              If you wish to 'compare' the memory usage, the closest thing you can find is this number in 'free' (the rest of the used memory is for buffers and caches as Jucato explained):
                           total       used       free     shared    buffers     cached
              Mem:       1034648     639932     394716          0     125308     287452
              -/+ buffers/cache:     227172     807476
              Swap:       979956          0     979956

              Comment


                #8
                Re: Why does Kubuntu use so much memory?

                windoze uses the disk as virtual memory. That's great at giving lots of free RAM, but rather poor from a speed point of view, as disk read/writes are slow.

                linux uses as much RAM as it has available. If you need something, chances are it's already loaded in RAM. That's fast. And if you "run out" of RAM, *then* pages of RAM are dumped to disk.

                Which is of course why linux is rather better than windoze. No, wait... it's just one (of many) reasons

                Comment


                  #9
                  Re: Why does Kubuntu use so much memory?

                  I don't know about you people, but despite the fact that I've got six desktops open with four programs running including Firefox (that I'm typing on) and Amarok (where I'm listening to music), I only have two active processes. I also have 102 processes that are sleeping i.e. they are not sopping up resources. Compare that to windoze and you'll get a different impression of which OS is bloated and which one is slim. In general, windoze has more bugs than Linux has lines of code, an amzing fact. You can look it up.

                  Comment


                    #10
                    Re: Why does Kubuntu use so much memory?

                    Wow. You guys are very, very helpful.

                    caserio, thanks for that awesome link. I'll read it when I finish this quick post. BTW, is qps installed on kubuntu by default? Can I just type 'qps' at the command line to run it? I can't check for myself right now as I am running that OS-we-all-came-to-hate-made-at-Redmond for a few days to run a game I recently got addicted to.

                    jakykong, what I meant by my statement wasn't actually that I wanted to deal only witht the command line, but because of my misconception of how linux manages its memory, I thought that my system was slow after using resources on process I didn't need (such as Bluetooth. I don't have any Bluetooth devices on my machine.) I thought that going to distro that requires manual micromanagement, I would "see" what gets installed and what doesn't, avoiding to run any packages/processes that I didn't need. I guess I was making hasty judgements about what I didn't know. But I'll do this sooner or later anyway, just for the heck of it.

                    Jucato, thanks for clearly explaining some of the nuances of Linux. Your post cleared up a lot of my misconceptions. This goes for Xena, too.

                    kubicle, I have an issue with the data in that row. shouldn't the 'free' value in the second row read the same as the 'free' value in the first? If application memory, disk cache and buffers all use physical memory, how do they not have a common total and '"free pool"?

                    askrieger, I have not been aware of how to distinguish active and sleeping processes (from KSysGuard, anyway). Also, my experience is that Firefox on any OS tends to use up a lot of memory, especially from my habits of opening about 12-20 tabs. (So, yeah, that makes it my fault that it has to use so much RAM).

                    Comment


                      #11
                      Re: Why does Kubuntu use so much memory?

                      Originally posted by Alienkind
                      kubicle, I have an issue with the data in that row. shouldn't the 'free' value in the second row read the same as the 'free' value in the first? If application memory, disk cache and buffers all use physical memory, how do they not have a common total and '"free pool"?
                      I'll elaborate a bit.

                      The second row tells the memory usage excluding caches and buffers, so the first number is memory used by applications and the second number is memory free to applications (as linux can and will automatically resize the caches and buffers if applications need more memory). So the second number is only 'free' to applications...and while applications aren't using it linux uses it for caches and buffers.

                      I hope that makes more sense.

                      Comment


                        #12
                        Re: Why does Kubuntu use so much memory?

                        Originally posted by Jucato
                        So next time you see Windows using only a portion of your RAM, or Linux using up almost all of your RAM, think about the purpose of RAM and how much is or is not utilized to fulfill that purpose.
                        Great info man. I did not think of that, this way.

                        Comment


                          #13
                          Re: Why does Kubuntu use so much memory?

                          reading the links from the topic above is a great help

                          recently i installed a new 512MB chip now i have 1GB and found out on my system that
                          the 2.6 kernels don't need to be recompiled to use more than 880MB of ram
                          probably many already knew that

                          for gamers changing the swappiness to 20 or less greatly helps to improve lag of heavy games specially for first person shooters like doom3 or q4 just to mention some since it will have more easier more mem for graphics
                          to better performance in games like homm4 UFO aftershock (games that load tons of graphic files) its bether to set swappiness to 80 or above since it will load most graphics from diskcache (but not the first time lol)
                          it will greatly improve homm5 after some turns
                          i couldnt get this kind of performance tweaks in windoze

                          tks to all who helped posting this i could really improve my gaming performance
                          hail ubuntu forever live linux

                          Comment


                            #14
                            Re: Why does Kubuntu use so much memory?

                            Is there any way to run Kubuntu with 128 MB of RAM? Any unecessary services/threads (processes) to disable?

                            I saw someone with Kubuntu and 128 MB or RAM, but it was very slow and sluggish.

                            Comment


                              #15
                              Re: Why does Kubuntu use so much memory?

                              I'd try kde-core for low RAM:
                              http://www.psychocats.net/ubuntu/kde-core
                              Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

                              Comment

                              Working...
                              X