Bug 230425 - kde 4.4 reaches easily maximum number of X clients
Summary: kde 4.4 reaches easily maximum number of X clients
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma4
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-12 10:35 UTC by Davide Rondini
Modified: 2010-04-06 20:05 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Output of xlsclients when close to the limit (3.81 KB, text/plain)
2010-03-12 10:40 UTC, Davide Rondini
Details
Output of xwininfo -root -children (15.95 KB, text/plain)
2010-03-12 10:41 UTC, Davide Rondini
Details
Output of xrestop -b -m 1 (75.59 KB, text/plain)
2010-03-12 10:42 UTC, Davide Rondini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Rondini 2010-03-12 10:35:10 UTC
Version:           0.3 (using KDE 4.4.0)
OS:                Linux
Installed from:    Fedora RPMs

Since I've updated to KDE 4.4.0 (Fedora 12 X86_64 RPMs), when I started an average number of apps (~10-15 windows opened), when I try to open another one nothing happens, or I get a error message like "Kdeinit was not able to start /usr/bin/appname". If I try to start the application from a console, I get the following error:

Maximum number of clients reached appname:  unable to open display ":0.0"

If I close some windows, I can then open others, but the limit is quickly reached again. If I run xlsclients I can see that the limit is reached when I have about 135 X11 clients. There is a very high number of clients called plasma-desktop (about 40~45). Is that normal?

Just after login, I have about 85 connections to X server (I tried with gnome, and this number falls down to 22), and just after opening Kontact it rises up to 105.

This problem never happened with KDE 4.3.x.
Comment 1 Davide Rondini 2010-03-12 10:40:44 UTC
Created attachment 41560 [details]
Output of xlsclients when close to the limit

This is the output of the xlsclients when the system has already reached the maximum number of clients, and some windows have been closed: xlsclients connection itself is refused otherwise.
Comment 2 Davide Rondini 2010-03-12 10:41:39 UTC
Created attachment 41561 [details]
Output of xwininfo -root -children
Comment 3 Davide Rondini 2010-03-12 10:42:17 UTC
Created attachment 41562 [details]
Output of xrestop -b -m 1
Comment 4 Aaron J. Seigo 2010-03-12 23:50:46 UTC
QGraphicsProxyWidget only accepts top-level widgets for embedding. Top-level widgets are created as native windows. QGraphicsProxyWidget does nothing to prevent this from happening, an so every QGraphicsProxyWidget results in a client window being created.

this is obviously sub-optimal and unnecessary.

btw, i wonder why the allowed connection # is so low on your system. 135 is really quite low.
Comment 5 Diego 2010-03-16 12:28:53 UTC
Looks like the problem got exposed by a recent Fedora update:
http://lists.fedoraproject.org/pipermail/kde/2010-March/006272.html
Comment 6 Davide Rondini 2010-03-20 11:58:00 UTC
Well, probably the count has to be done not with the output of xlsclients, but with xwininfo -root -children: this reaches up to 255 windows when the system starts refusing connections. As far as I can understand by googling around, 255 is the standard limit used by xorg. In some situations, I can reach the limit with just 7-8 windows truly opened (Kontact, firefox, dolphin, konqueror, kate, virt-manager and kopete), even with desktop effects disabled. I verified it on at least three different machines. 

xwininfo -root -children shows a number of children saying:

(has no name): ()  1x1+0+0  +0+0

Maybe they are memory leaks (my guess, anyway). Probably I was wrong relating it with plasma, maybe it is connected to Qt, xorg or something else, but it looks like not to be just a matter of an unoptimized widget.

As far as I see, the problem appears in Fedora (and it persists updating to KDE 4.4.1 and xorg 1.7.5.902), so I'll file a bug also there.
Comment 7 Davide Rondini 2010-04-03 10:51:38 UTC
I've just reconstructed a session reproducing the bug starting some
apps which I usually use and tracking the output of commands xlsclients and
xwininfo -root -children between every application launch (see attachments). I
followed this procedure, with the numbers between parentheses respectively the
output of the commands:

1: xlsclients | wc -l
2: xwininfo -root -children | wc -l

0. Boot
1. Login into KDE (this automatically activates yakuake, nm-applet, kopete and
kmix) (67/106)
2. Launch kontact (93/146)
3. Launch Firefox (94/157)
4. Launch Dolphin (97/163)
5. Launch Kate    (103/171)
6. Launch Okular  (106/176)
7. Launch Konqueror

When trying to launch Konqueror, the app did not start. Then I tried to launch
it from yakuake console, and it started, but at that point the x commands
respond:

Maximum number of clients reachedxwininfo:  unable to open display ':0'

The real number of apps opened may vary, but anyway after 7-8 windows the
problem appears every time.

I've reproduced the bug on three different machines with Fedora 12, both with
nvidia proprietary and Intel video drivers.
Comment 8 Alexis MENARD 2010-04-06 06:20:34 UTC
http://bugreports.qt.nokia.com/browse/QTBUG-8034

Reported but not fixed :D.