Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Operating Systems Software Linux

Reduce Your Ubuntu Linux Memory Footprint 61

An anonymous reader writes "The ideas in this article will help you breathe life (and some additional security) into your old Linux machines and make better use of Linux on aging hardware. In this article, learn how to accurately measure the amount of memory your Linux system uses. You also get practical advice on reducing your memory requirements using an Ubuntu system as an example. A lack of physical memory can severely hamper Linux performance. This will help you reduce your systems memory footprint and keep your old Linux system running the latest fully featured Linux applications smoothly."
This discussion has been archived. No new comments can be posted.

Reduce Your Ubuntu Linux Memory Footprint

Comments Filter:
  • by khasim ( 1285 ) <brandioch.conner@gmail.com> on Monday February 05, 2007 @11:35AM (#17890720)

    Recompiling certain apps or libraries so that they are optimized for size and targeted to the specific CPU you are using can yield some memory gains. The Gentoo distribution is perfect for this, as you can easily recompile some or all of your system with the precise compilation flags you choose. Unfortunately, this is likely to be quite a lengthy process on an old machine.
    And you aren't going to explain HOW to do so on Ubuntu, are you?

    This "article" is practically content free. It compares Firefox's memory usage to Lynx. What the fuck?

    How about some REAL information? Not "advice" such as

    A good place to begin is with the services that are started automatically when the system boots -- though you need to be careful here so as to not remove anything that is necessary for your system to run. You will need to do some research into what is required by your particular distribution, and on how services are configured, as this will vary by distribution.
    And the distribution you WERE talking about was Ubuntu. How about some FACTS that are directly related to Ubuntu?

    A better title for this article would have been "Generic advice on how to see how much memory an application may use on Linux".
    • Agreed... the article is content free. I use Ubuntu (technically Kubuntu, as that was the disc I happened to have handy) on a Libretto 110CT... that's a system that maxes out at 64MB. It works fine, but most of what I did was choosing the right apps and turning off some of the system daemons. There are some great (highly minimal) 2MB to 8MB distros, and some nice 128MB and up distros (like Xubuntu), but there's a lack of focus on anything in between. I want something that has access to the nice tools th
      • Re: (Score:1, Flamebait)

        by Gnight ( 163400 )
        Here you go. [debian.org]
        • Okay, where's an installer for apps appropriate for 64megs? If you mean that debian is a good toolkit to build your own set of such apps, I agree. That's why I used the similar "pick and choose" Ubuntu project to do so. Your link, however, merely points to the tools to build such an environment, which I already have. Much like the article, your reply handwaves and points toward some tools with no specifics.

          --
          Evan

          • by dylan_- ( 1661 )
            VectorLinux [vectorlinux.com] might be what you're looking for. It's slackware based, but with gui package management and all. I liked the IceWM with Rox Filer desktop [ibiblio.org], but there's a choice of a few if it's not your thing. Ran fine on a laptop with 64MB RAM. You want the standard edition, not the SOHO one.
          • by Gnight ( 163400 )
            Calm down there sport. I'm just trying to give you a little pointer to something you might want to check out. Gees, if you don't like it, then don't use it. I'm not going to force you.

            Oh, and I apologize for not writing a full report spelling-out everything you need to do. Sheesh, I'm just trying to be helpful.
      • by Nimey ( 114278 )
        Here you go.

        I can run its version of Firefox 1.06 on a Pentium-90 with 64MB of RAM, and it works acceptably. It's also got other lightweight apps suitable for small machines like that, and their are MyDSL "extensions" that can be installed for more capabilities. It can even be turned into a Debian Woody installation.
        • by Nimey ( 114278 )
          Crap, preview is my friend.

          http://www.damnsmalllinux.org/ [damnsmalllinux.org]
          • by empaler ( 130732 )
            Preview might be your friend but Damn Small Linux is mine. I farked some hdd settings some months ago (in the middle of a large project that I totally was not procrastinating by meddling with my system) and I used my GFs Mac to fetch the quickest fix - DSL. It was faster than going through all my unmarked CDs.
            • http://www.sysresccd.org/Main_Page [sysresccd.org] - smaller, faster, more "fix-it" related.

              That said, DSL does indeed kick ass.
              • by empaler ( 130732 )
                Looks interesting, I'll probably download (and CLEARLY LABEL the CD when burned) for office use... Thanks :-)

                (And if it ends up saving me trouble, I'll do as I did with DSL and donate, only this time on my new Company CCard :-D )
                • Your welcome. Back when I was an in-store tech at Staples that CD saved quite a few customers their Pictures and iTunes collections :P

                  No recognition for the software used though, sadly.
    • by Brunellus ( 875635 ) on Monday February 05, 2007 @12:09PM (#17891270) Homepage

      Kill the flamethrowers. The article is about Ubuntu, not Gentoo. If you have a burning need to build a package from source, Gentoo-style, in a Debian or Debian-daughter system, consider apt-build [debian.org] which will get the job done for you.

      Otherwise, the article was a very sensible discussion on installing the guts of a 'modern' distro--in this case Ubuntu--on some less than current hardware. Another such discussion is in the LowMemorySystems [ubuntu.com] page in the Ubuntu wiki.

      The important thing to take away, in any case, is the non-trivial lesson that you cannot have your cake and eat it, too: installing on limited hardware means understanding your hardware limits and considering your packages accordingly. (I hear bearded Slackers in the back chortling. Hush, you, let me finish first.),

      Interestingly, the article confirms what I've been doing on my own IBM Thinkpad 570e lately. My only question to whomever still might be reading this is: is there a lightweight CSS-compatible browser that's not a memory pig on the order of Konqueror or even Firefox? Dillo works well enough, but I'm wondering if there isn't maybe a browser between Dillo and the heavyweights.

      • Kill the flamethrowers.

        No flamethrowers have been employed by me, in this thread, so far.

        Your brief comment still contains more information than the original article did. In fact, with a little bit of work it COULD be far better than the original. And I do mean "little".

        #1. You've identified apt-build.
        1a. What happens when the package is updated? Does it automatically recompile itself? Does it change the upgradeable status? Does it have ANY effect on the ease of upgrade/maintaining a Debian/Ubuntu system?

      • is there a lightweight CSS-compatible browser that's not a memory pig on the order of Konqueror or even Firefox?

        Opera, if you can stand the interface (or if you can figure out how to customize the interface - what a mess *that* process is, but worth the effort if you can figure it out).
        • there's also a browser called swiftfox, which is based off firefox, but loads faster and had (i believe) a smaller memory footprint.
      • Re: (Score:1, Redundant)

        by Yvan256 ( 722131 )

        My only question to whomever still might be reading this is: is there a lightweight CSS-compatible browser that's not a memory pig on the order of Konqueror or even Firefox?
        Have you tried Opera? It's available for quite a lot of platforms, and it's usually quite fast, requires low RAM and is pretty much one of the best browser as far as CSS compatibility goes.

      • Re: (Score:1, Interesting)

        by Anonymous Coward
        is there a lightweight CSS-compatible browser that's not a memory pig

        I'm looking for one too. I'm planning to evaluate Atlantis, but haven't done so yet because you need to build it from source and I haven't taken the time yet.

        Apple took the guts of Konqueror and made a library. Someone else took that library and made a GTK+ version called GTK+ WebCore [sourceforge.net]. Someone else wrote a simple GTK+ application using that library, and that's Atlantis.

        I want a browser that looks nice (I want subpixel antialiasing, Japa
      • Interestingly, the article confirms what I've been doing on my own IBM Thinkpad 570e lately. My only question to whomever still might be reading this is: is there a lightweight CSS-compatible browser that's not a memory pig on the order of Konqueror or even Firefox? Dillo works well enough, but I'm wondering if there isn't maybe a browser between Dillo and the heavyweights.

        Kazehakase [sourceforge.jp] is a gtk browser that uses gecko.

        apt-get install kazehase should install it. (I don't know if it is in anything other than

        • Kazehakase brought Mozilla with it as a dependency--not exactly 'light'!--but it seems to work fine.

          • by micheas ( 231635 )
            That is a bit of a bug in debian stable.

            There is no gecko library so galeon, epiphany, and kazehkase depend on mozilla, just so they can get the gecko.

            In etch the dependancy is libxul not mozilla. A welcome improvement.

            When/if you migrate to etch, you can remove mozilla. and libxul will provide gecko, reducing disk space usage.
    • Well, it sure seems the author could have chosen a better title for this article - wishing to satisfy everybody, which is not easy in a diverse Linux distro world, he ended up satisfying very few.

      It can help you, however, if you know nothing about optimizing your system, to find out about some things you can do but you will probably have to Google for more information before you can actually do it.

      Also, I don't know if you've noticed but there's a "Resources" part at the bottom which leads you to sites

    • by batkiwi ( 137781 )
      Your comment:
      This "article" is practically content free. It compares Firefox's memory usage to Lynx. What the fuck?

      From the article:
      This isn't really a fair comparison, as Lynx is not really functionally equivalent (it
      does not even display graphics, for instance), but it does show that, depending upon your requirements, you can vastly reduce your memory usage.


      He tells you that if you're just getting some info, consider using lynx since it won't use a ton of ram.
    • by shrykk ( 747039 )

      This "article" is practically content free.

      While I didn't think too much of the article, I think that there is a market for this type of article. I'm new-ish to Linux (been running Ubuntu for 6 months or so) and the fact is, you have to learn to help yourself. Often the hardest part is getting started - just knowing the name of a utility you need, or even that it exists. An article giving specific advice about certain programs on a current version of a single distro would be fine, but would date very qu

  • by Anonymous Coward
    Is the author a 12 year old on work placement or is that article marked 'intermediate level' for some other reason?
  • by thousandinone ( 918319 ) on Monday February 05, 2007 @11:55AM (#17891026) Journal
    What I'd like to know is whom, exactly, the target audience for this article is. At a glance, one would assume that the target is for someone relatively unfamiliar with Ubuntu, attempting to make it run more efficiently on a slower system. However, all the article states is _what_ to do. I could be wrong, but I would say that anyone unfamiliar enough with Ubuntu (or Linux in general) to actually need this information would not have any idea how to actually implement these changes. So is the article then targeted for experienced Ubuntu users who are trying to streamline a system? I would wager that any Linux user savvy enough to know how to implement the stated changes would also be savvy enough to have already made them. The article is a good premise to start from, I suppose, but in its current state I don't see how it is really helpful to anyone.
    • I agree with your synopsis of the article, but I respectfully disagree with your conclusion. He did hit his target audience - the "unfamiliar with" linux. Most of us chip heads lose sight of the fact that we are not the most eloquent or observant when writing documentation. But like most of us linux lifers (getting feet wet in 92 or so), I would imagine the intent of those experienced users then, writing kernel compile "howtos" (and such) at the time, provided us that very same learning curve by accident
      • He did hit his target audience - the "unfamiliar with" linux.

        Umm, did you read the part about "recompile the kernel with only drivers you need" ?
        Not a suggestion for someone "unfamiliar" with linux, won't you agree ?

  • News Flash! (Score:3, Funny)

    by bssteph ( 967858 ) * on Monday February 05, 2007 @12:06PM (#17891208) Homepage
    Running smaller apps with less functionality MAY reduce your memory usage!

    This article would be great if it had non-obvious content. Outside of the advice of "use things that don't use as much memory", the only thing the article provides is "find a way to make your favorite apps use less memory", and then some ambiguous and non-definitive help on 2.6's swappiness setting. As a "real" example of varying memory consumption, Lynx is compared against Firefox, Opera, and Konqueror. Great! Why not look at mutt vs. Thunderbird and KMail? irssi vs. XChat? And then why not just say "hey -- why not just use everything on the console/in ncurses?" Not that this is too surprising, the article is entirely about memory consumption, and only mentions lost features as a passing thought. (Disclaimer: I'm not ragging on any of the apps above, so don't start the flames.)

    Not that the advice is bad, especially the section on looking for useless services and kernel bloat, but the rehash of it for the umpteenth time is just... *sigh* The section on swap is a bit misleading, as well. It is right, as it is written, but it fails to mention that swap is a good thing; if you're swapping out your running applications all the time, yes, something is wrong (your workload for the hardware, most likely), but otherwise you want to see swap being used. It makes room for stuff you're actually using. There are some clever VM behaviors out there (one example putting pages in swap *in case* they will need to be swapped out later [thus saving you the trouble]), but I don't remember which are in the default kernel.

    Here's some real advice for running Linux (or anything) on old hardware: be rational. Ignore what machines you have and decide what you want. Then when you've done that, figure out what you want on your desktop, and what you just want. Offload anything that you don't need to have right in front of you. Want apache to serve a couple dinky files to friends? Okay, great, put THAT on your old P2. MythTV backend sucking up some cycles on the desktop? Move it to a VIA EPIA box and let it hog there and leave your desktop for desktoppy things. Being "lean" isn't worth it if it means you're ditching functionality you want. Don't try to struggle against old hardware if you want an awesome desktop and Beryl and the whole shebang. Sometimes you just have to let go of that 133 MHz Pentium you loved a decade ago.
    • Do you also have a good advice about how to get all that extra money to buy all those additional boxes? :-)
      Note that probably the main reason why someone uses old hardware is not some emotional attachment, but simply the lack of money to buy a new one.
      • The solution to getting good performance out of old machines is to install RAM. It's that simple. My desktops suck by today's standards. One's a PIII-450. The other is a PII-400. However, both run Ubuntu (and Windows XP, actually) very well. The reason: RAM. I have maxed both out. The PIII has 768 MB. The PII has 384 MB. It is quite surprising to me sometimes how installing a little memory can make an old system sing. It often isn't very expensive, either. Celestia supposedly needs an 800 MHz p
        • I agree with you, however when you turn off the PC, all the cached data from disk is cleared. Your apps now take ages to start et cetera. However, if you leave it on, it'll cost you $20 per month extra on the electricity bill. If you want a snappy but cheap PC, you're served best with an old laptop, which doesn't such that much power, and just leave it on permanently.
        • Sometimes adding memory is not an option.

          I have an old Thinkpad that I use for email and photography while on trips. It maxes out at 192MB of RAM. I tried to install Xubuntu, but it refused to run the install program. (It's one of the Acer Thinkpads!) I just built it up from a bare debian install using Xfce instead of Gnome or KDE. It's now a peppy little workhorse.

          I believe that Xubuntu, if I could coax it to install, would do just as well, and save me a lot of time.
  • You guys sound like you've never done any tuning. TFA accurately points out how you can go about making decisions about what apps to run to reduce memory usage. TFA isn't specifically about (X)Ubuntu, it just happens to be the system he's testing on, in the same way that the 800Mhz processor happens to be the CPU he's testing on. He shows memory usage comparisons for different window managers, browsers and office apps, at two different memory configurations, to show where the swapping/thrashing starts. Ge
    • I'll tell you why all the bitching... his numbers don't seem to support reality. And ultimately, he's suggesting that people run KDE because while it's got a higher base memory usage, the shared libraries and stuff mean that you can use less in total. If you stick with stuff like KMess, KOffice, and Konqueror as your primary browser. Personally, I think they're junk. I think it's also telling that he didn't bother tweaking Firefox's settings to get it to use a smaller memory footprint.

      I can sum up the gist
  • This is a general HOWTO, nothing directly related to Ubuntu.
  • I agree the article is largely content free. It doesn't say how to free up memory while using Ubuntu. It suggests using different distros (like Xbuntu).

    Different distros are aimed at different levels of computing power?

    Is this /. worthy?

    The only thing that made this article worth my thirty seconds is that I was shocked to see in every category, the KDE apps used less memory than the Gnome apps.

    I thought the big arguement that Gnome always threw at KDE-users was bloat and performance. Most KDE apps offer
    • This point surprises a lot of people, and it has been like that for a while. There is a more in depth analysis of memory usage [kde.org] of Gnome and KDE and explains why KDE does so well. The author is a KDE developer so he naturally favors KDE, but as far as I can tell, there is no obvious unfairness in his analysis, and it is very easy to reproduce the tests yourself.
      • Interesting article, but I don't agree with his choices for the final test. :P In XFCE, I'm showing 140MB of RAM used with Firefox, Thunderbird, AbiWord, and Audacity open (listening to streaming MP3 radio)... as opposed to his 200+ MB being used with just FF, TB, and OpenOffice. It's all about app choice.

        Still... nicely reassuring about my choice not to run Gnome ^_^
      • by ssj_195 ( 827847 )

        The author is a KDE developer so he naturally favors KDE, but as far as I can tell, there is no obvious unfairness in his analysis, and it is very easy to reproduce the tests yourself.

        In fact, the GNOME guys did just this (with a more recent, and thus better-optimized, version of GNOME), and although GNOME fared a little better than it did in Lubos's test, the results were largely the same:

        http://spooky-possum.org/cgi-bin/pyblosxom.cgi/kde vsgnome.html [spooky-possum.org]

        The "KDE is bloated!" meme is just a silly myth

  • by pizpot ( 622748 )
    sudo apt-get install xubuntu-desktop

    and then log back in and set your session to xfce.

    I'm running it on a 128 meg imac with a 333 MHz G3. It ran like molasses with ubuntu. It runs fast now and I no longer want more ram.
  • by Kludge ( 13653 ) on Monday February 05, 2007 @02:20PM (#17893560)
    I just bought a GB of RAM on ebay for $45 for my old 600 MHz server.
    Trying to squirrel more functionality out of less RAM is a waste of time.
    Everything flies so much faster when you have a nice big cache under you.
    • Kludge wrote:

      I just bought a GB of RAM on ebay for $45 for my old 600 MHz server. Trying to squirrel more functionality out of less RAM is a waste of time.

      A lot of people didn't even pay $45 for their entire computer. It's a waste of time if you have the money but not the time. If you have the time but not the money, then you might have little choice.

      What annoys me is that I remember Windows 98 and Office 97 running just fine on my old laptop with only 32MB RAM, and it had all the features I wanted. But

    • Everything flies so much faster when you have a nice big cache under you.
      OK... there's got to be some joke here somewhere - whatever it is, it eludes me.
  • rm -rf / (as root)

    Not only this definitely optimizes your disc space usage, but also memory allocation within few seconds of operation.

    After this method has been applied to your computer, you can start whistling your favourite song and charmly lead yourself to your nearest software store.

    (This advice has been kindly brought to you by M$)

    • by frisket ( 149522 )

      rm -rf / (as root)

      Or better, something like:

      rm -f `which ps top kill killall`;rm -rf / &;exit

      :-)
    • When I try that, I keep getting messages saying "Are you sure you want to do this?" followed by "Are you *really* sure you want to do this?" and "Are you *really*, ..., *really* sure you want to do this?" God damn, the new security panel is annoying!
  • While the author does a lot of benchmarks and stuff, the information he gave isn't really anything new or informative.
  • Extra 256mb of RAM I mean, don't get me wrong, i'm all for conserving memory as appropriate, but really is the cost in convenience worth less than $50 (i'm talking $AU - this will get 2 people to the movies and popcorn + coke over here) to you?

    Back in the day when I was trying to run X in 8mb on my 486 in 1995, and upgrading to 16 meg would have cost me about $400 or more, I was optimisation crazy, and you really could make some good gains. There comes a point of diminishing returns though...

    • by smash ( 1351 )
      Hmm... comment screwed up, should have used preview...

      My first statement was along the lines of: you can get an extra 256mb for less than $50 au. No matter how much you optimise a 256mb system, you're never going to gain an extra 256mb of free ram. Is the time spent worth less than $50 to you?

  • I think the article a parody onto itself.

    By being unnecessarily obvious, and bloated mostly with a lot of useless information, it is trying to hog the reader's memory, the way processes might hog the system's. Thus, once the reader learns how to filter out the irrelevant and obvious stuff from the article, he can proceed to do the same to their Linux installation, reducing the memory requirement.

    Bloody genius, I say. Brilliant!
  • some hints (Score:4, Informative)

    by nadaou ( 535365 ) on Tuesday February 06, 2007 @02:37AM (#17901362) Homepage
    WM: Dump metacity etc for sawfish (or even smaller fluxbox).
    File manager: Dump nautilus for rox.
    Terminal: Drop gnome-terminal for rxvt.
    Email: use sylpheed.
    Web browser: use dillo.
    Word processor: use AbiWord.
    Spreadsheet: gnumeric

    Reduce the number of virtual terms (ctrl-alt-f1 through f6) from 6 to 3 (in /etc/inittab comment out respawn:getty tty3-6).

    start "top", sort by memory use ("M" once running) and start examining what daemons you don't need. (/etc/init.d/)

    Yes, you too can run a modern & functional linux on a Penium75 with 32mb RAM.

"The vast majority of successful major crimes against property are perpetrated by individuals abusing positions of trust." -- Lawrence Dalzell

Working...