Wednesday, February 17, 2010

System Activity - X11 Memory

System Activity now has a column "X11 Memory" as such:

This shows the amount of pixmap memory for a process. This value will be slightly lower that the value reported by Gnome System Monitor or xrestop because those programs take almost-random guesses at how much extra memory the processes use for fonts, pixmaps etc.

I have already created a bug reported against kmix which uses 1MB of memory for its dialog box which is almost always hidden. Feel free to report bugs against other such problems :-)

Originally I thought that this feature would not be possible because xrestop uses up a lot of CPU to gather these statistics. This is because it ends up doing an O(N^2) look up of processes, requiring an awful lot of round trips to the X server. I reduced this to an O(N) lookup and got the CPU usage down to about 30ms. Considering collecting and drawing everything else takes 60ms, this is still significant so this column is not shown by default.

Also, sorry everyone for breaking the build for those of you with weird X11 installations. cmake still gives me headaches. If you have problems compiling kdebase/workspace, because of ksysguard, with the latest svn version and after doing a make clean, please tell me.


Sho said...

Nifty. KSysGuard is really one of the gems of KDE 4.

Moltonel said...

That's *very* usefull, thanks a lot.

I sadly expect this will only arrive in SC 4.5 because of string freeze ?

Tom said...

Nice feature, but is it enabled by default?

I already find the columns a bit confusing and I've used Linux for ten years. If I bring up the system activity I want to do two things - identify the program that is making my computer slow, and/or kill something. I'm sure that three columns with slightly different labels on "memory" are going to confuse the majority of KDE users!

SexyMimi said...

Awesome ! This is gonna change the way i free memory during rude times !

Thanks a lot, and thanks for KSysguard (best software of the kind ever, by the way) !

Petru Avram said...


"Considering collecting and drawing everything else takes 60ms, this is still significant so this column is not shown by default."

As you can read clearly it is disabled by default not because of the visual UI clutter but because it adds performance penalty.

Bille said...

You rock, John!

JohnFlux said...

Moltonel, yeah 4.5 only, sorry.

Plus this sort of change needs some time for people to test etc.

Anonymous said...

Hi John, works perfectly here. And I love all the speed improvements you made. I remember initial versions, where just looking at it consumed some 10% CPU, but now it barely shows up at all.

Is it possible to get any more information about the heap and its fragmentation?

PS: The build failures should be fixed now.

Anonymous said...

Nice! What I would also like to see is IO usage per process from /proc//io.