Ramblings of a Spooky Possum

Tue, 05 Dec 2006

KDE vs. GNOME: Memory Use

About a week ago Quim put out a call for better profiling of whole-desktop resource use. This isn't it, but it is a start. Consider it more of an update of Lubos Lunak's comparison from GNOME 2.14 vs. KDE 3.5.2. In that comparison KDE won by tens of megabytes.

I have cooked up a perl script that wakes up every 30 seconds, takes a look at what is going on and writes it out to a log file. The most interesting parameters it currently records are the total memory use (equivalent to what free returns on the -/+ buffers line). Be warned that the script is currently completely undocumented and you will have to read the source to find out where the default log file goes and how to change that. It is also completely Linux specific. I am also deeply suspicious of some of the data it returns. Most definitely a work in progress, but I couldn't give the results below and keep it hidden.

I am far from certain that everything is being done in the best possible way. For example look at Lubos' comparison for a discussion for reasons why free isn't necessarily a good measure of memory use; this script uses the same approach as free. On top of this I have no real indication of the uncertainty in these results. Finally, I did things a bit differently from Lubos so direct comparison with his numbers is impossible.

My method was to burn live CDs for Ubuntu, Kubuntu and Xubunutu. This gives an identical base system. The KDE version is 3.5.5 and the GNOME version is 2.16. Xubuntu uses Xfce 4.4 beta 2. Once booted into a CD the script was launched on a USB memory stick and left to run. I then started a series of applications (the generic ones from each desktop):

All applications were launched "empty". If any configuration was needed (e.g. mail addresses) it was done minimally. There was no network connection. The exception to the "empty" rule was the movie player which in each case played "Experience Ubuntu.ogg" in the Examples folder. Once done, the applications were closed in reverse order.

As representative measurements, I have chosen the initial memory use and the peak memory use. I will also give a list of the top five applications during peak memory use (based on RSS). So, is KDE still beating GNOME hands down, or has a surprise reversal occurred?

GNOME 2.16KDE 3.5.5Xfce 4.4 beta 2
Initial (kB)159024158672134060
Peak (kB)228016230492210740

KDE and GNOME identical to within a few MB!? How can we start a flame war with that? A very big congratulations to everyone working on the optimisation of GNOME! Now you just have to worry about what surprises KDE 4 will pull.

Top five processes by RSS memory use:

RankGNOME 2.16KDE 3.5.5Xfce 4.4 beta 2
1totemkaffeinegxine
2firefox-binkontactmozilla-thunderbird
3Xorgkonquerorfirefox-bin
4nautiluskateXorg
5evolutionXorgxfce4-terminal

Note how the movie players top the list in every case, this is almost certainly due to the fact that it is the only program with any data loaded. For comparison, long term use on my normal (GNOME 2.16) desktop gives the following list of processes over 20 MB:

  1. epiphany
  2. Xorg
  3. evolution
  4. beagled
  5. nautilus
  6. beagled-helper

My long-term use of this script is limited. It hasn't been run on an in-use desktop from log-in. I currently have five days of data from a heavily loaded desktop (the window list doesn't fit on the screen). The good news is that GNOME does not appear to have major memory leaks. The bad news is that once I get more data the gedit guys might be in for a bit of a shock (hint: memory use shouldn't go up when I close a file - you'll get a bug report once I've tested 2.17).

A few technical notes:

So that's it, the two major desktops look to be almost equivalent in their memory use. I'll sign off with the caveat that errors in my method might show up, so be careful citing this article as some sort of authority. Feedback is welcome, mail me at callum@spooky-possum.org.

[22:25] [Permalink] [Feedback]