Version: 1.3.2 (using KDE 3.2.2, (testing/unstable)) Compiler: gcc version 3.3.3 (Debian 20040401) OS: Linux (i686) release 2.6.4 There is evidence that Konsole is not sharing memory for the background image between the various sessions. For instance, on my system, a xrestop indicates : res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier 3400000 54 126 5 69 72 15992K 10K 16002K ? Terminal - Konsole Adding a new session to Konsole makes the memory go up by about 5 megs : res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier 3400000 57 126 5 68 74 21256K 11K 21267K ? Terminal - Konsole All my sessions are using the same background.. Why should memory usage increase?
observed same here (yellowdog 3.0, kde 3.2.2 compiled from sources): xrestop 0.2, konsole with one session: Pxms Misc Pxm mem Other Total PID Identifier 109 60 5599K 9K 5609K ? pegasus@moonlight:~ - Shell - Konsole two sessions: 117 62 10690K 10K 10701K ? pegasus@moonlight:~ - Shell No. 2 - Konsole three sessions: 119 64 15779K 10K 15789K ? pegasus@moonlight:~ - Shell No. 3 - Konsole and so on ... i have konsole set for transparency with dark background.
Confirmed, Konsole isn't sharing memory for background images between sessions.
actually this is Qt problem, konsole creates Qt widget for every session and the background assignment is done in Qt. so Qt must be taught to share images. konsole cannot be fixed to support this (at least not easily)
Roman, I'm not so sure this problem can be blamed on Qt. And, I think konsole can be improved in this regard, although it might involve bypassing the use of KRootPixmap. In konsole.h, there is a container of pixmaps called rootxpms. Depending on the relevant scheme, a KRootPixmap is attached to each terminal widget to implement the transparency effect. Internally KRootPixmap is copying the desktop wallpaper image from the X11 server into a KSharedPixmap (inheriting KPixmap inheriting QPixmap). Then, in KRootPixmap::updateBackground another QPixmap copy is made, with darkening or lightening applied - and passed to the TEWidget. So, it seems that there is a copy on the server, and two copies per TEWidget. If there are five terminals using the same scheme, it ought to be possible to reduce this from 10 copies to 2 copies by having one KRootPixmap per scheme, rather than one KRootPixmap per terminal. However, KRootPixmap is designed to update a particular QWidget rather than a collection, so perhaps an efficient KRootPixmap needs to be forked into the konsole scope. Please correct me if you find anything incorrect with this analysis. Nigel
It could definitely be improved in Konsole, in fact there is another bug report with a patch which needs tidying up, testing and committing.
sorry for the long delay :( Nigel, I think your analysis is correct. The problem imho is that 10 terminals (tabs) using the same scheme means that there are 10 copies of the same background pixmap. I see two possible solutions to this problem - either we can teach konsole to use one KRootPixmap per scheme and not per terminal (as you suggest) or we can teach QT how to share backgrounds if they are the same for this given widget. thnx for looking into this
Konsole/KDE 4 only does translucency via composite, so there is no more usage of KRootPixmap.