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):
- Web Browser
- Terminal
- Text Editor
- File Browser
- Movie Player
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.16 | KDE 3.5.5 | Xfce 4.4 beta 2 | |
|---|---|---|---|
| Initial (kB) | 159024 | 158672 | 134060 |
| Peak (kB) | 228016 | 230492 | 210740 |
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:
| Rank | GNOME 2.16 | KDE 3.5.5 | Xfce 4.4 beta 2 |
|---|---|---|---|
| 1 | totem | kaffeine | gxine |
| 2 | firefox-bin | kontact | mozilla-thunderbird |
| 3 | Xorg | konqueror | firefox-bin |
| 4 | nautilus | kate | Xorg |
| 5 | evolution | Xorg | xfce4-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:
- epiphany
- Xorg
- evolution
- beagled
- nautilus
- 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:
- The GNOME browser was Firefox, not Epiphany, since that is what Ubuntu defaults to. Lubos' work suggests that Epiphany saves between 2 and 6 Mb over Firefox.
- The XFce figures don't include a text editor. I might be blind, but I couldn't find a graphical one in Xubuntu's menus. I didn't want to skew the memory use by doing some sort of search or launching applications I wasn't sure about. I'd be surprised if this made any significant difference. Xfce was always going to win a memory-use battle.
- I recorded the top ten processes, but only noted the top five above. Some results in places 6-10 concern me so I excluded them (e.g. the Xfce list has perl at number eight and it could quite easily be the monitoring script itself).
- Xubuntu obviously suffers because of the reliance on Firefox and Thunderbird, neither of which subscribes to the lightweight Xfce ethos.
- Curiously, Xubuntu seemed to be the most sluggish to launch applications. I was watching DVDs while doing this so it might just have been a boring bit and I wasn't distracted enough while waiting.
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.