KDE 4 'consumes 39% less memory than its predecessor'

Not mine, but one Korneliusz Jarzebski (in Polish) has done the numbers (pro-linux coverage in German) and produced a chart showing exactly how the RAM consumption of comparable KDE4 and KDE3 sessions measure up. The result is a mindblowing 39% smaller memory footprint in KDE 4. This just goes to show, that it's worth making large-scale changes to your desktop environment to get the fruit hanging on the higher branches. Wait for the mini- and micro-optimisations to start happening in KDE 4.x, too.


Those numbers look too good to be true, so I'm making my own measurements.

By Will Stephenson at Mon, 12/10/2007 - 20:35

ksnapshot itself took 22mb under kde3. This clearly tells me that they are counting shared-libraries too. If kde saved 40% in kdelibs and nothing in the rest (extreme picture but still), then we did not save 40% overall but much less...

This benchmark is simply wrong and broken imho

By config at Mon, 12/10/2007 - 21:00

And they are. The numbers may be right, but the conclusion is completely wrong.

If you look at each application individually and you notice that the memory usage is lower, you can't tell much. There are several reasons why that might be and only one of them is that the program is more memory-efficient. In fact, if it were less memory-efficient and the amount of RAM available were exhausted, then each application individually would have a smaller RSS due to more aggressive swapping.

But, if you look at the trend -- all but one of the applications showed less memory usage -- then you can make a qualitative conclusion: KDE 4 uses less memory in general.

So far, so good. The conclusions up to here are just fine.

The moment that the author started summing the numbers, he started screwing up. Memory usages are not additive. If programs A and B are each using 5 MB and share 80% of that with each other, then A + B isn't 10 MB but 6 MB only. Basic set theory. In order to calculate the total memory usage, we'd have to ask the kernel to list each and every page used at least once, without duplicating it.

The Linux kernel doesn't do it.

So, we may only take a qualitative conclusion from the numbers presented. Not a quantitative one.

By Thiago Macieira at Mon, 12/10/2007 - 22:08

Smaller memory footprint is sooo obvious. Even when I turn on all composite effects memory is less used than with kde3.

By fbrcic at Tue, 12/11/2007 - 01:55

Gercekten cok guzel bir haber. Bizim de kde3'ten istedigimiz buydu. Daha guzel haberler beklemekteyiz...

By yorumcu at Wed, 04/02/2008 - 16:14

This is yet another case of "I don't know how to measure memory usage properly, but I'd like to present my numbers anyway". There's no reasonable way how 6 kio_file processes could take almost 60MiB of RAM.

By Lubos Lunak at Tue, 12/11/2007 - 18:26

What really counts is the amount of private dirty pages, because that is inevidently what will swallow up the most and eventually lead to swapping. Just run:

pmap `pidof -s whatever`;

and look at "Total:" row, "dirty" column. Use of the pmap_dirty script (floating on the inet) facilitates this, and you may also specify multiple PIDs, where pmap only recognizes one.

While we are at it: kdm 3.5.7 process alone has a mere 184K dirty, 380K private-writable (3060K readonly private, 0K shared). I doubt kdm4 is much less hungry.

By hideakisama at Thu, 12/13/2007 - 18:32