Submitted by Cord on
Every two weeks i get this:
$ xterm & Xlib: connection to ":0.0" refused by server Xlib: Maximum number of clients reached xterm Xt error: Can't open display: :0.0
and it looks that something eats up the possible number of Clients:
$ xlsclients |wc -l 56
when i restart X i can open about 100 xterms until i reach the error message.
ideas?
distribution:
- Cord's blog
- Log in to post comments
Comments
Martijn (not verified) replied on Permalink
Gecko-based webbrowsers (+ some plugins) tend to eat clients.
Cord replied on Permalink
I don't run browsers on that machine, but i suspect gkrellm or synergy to eat up the clients, but how can i find out?
Johan (not verified) replied on Permalink
DOes "xlsclients" not tell you what you need to know?
Cord replied on Permalink
Nope. It tells me which clients are there. it doesn'T tell me why i can run about 100 Clients after X restart and only 50 or less two weeks later.
_Mark_ (not verified) replied on Permalink
Hmm, I was going to suggest `lsof` but it seems to only show the X server side of the socket, even with -U; the client side is "unix 0x0000000000000000" but that's the same for dbus and other unix domain sockets too, which is strange. (It would at least let you see how many things really do have connections open; `/tmp/.X11-unix/X0` is `:0` in particular...
pzanoni (not verified) replied on Permalink
Some of your user-space stuff is calling XOpenDisplay without XCloseDisplay. There's probably some app to show that, but xlsclients won't help you.
Try this program:
/* gcc clients.c -o clients -lX11 */
#include
#include
int main(void) {
int i;
for (i = 0; i < 512; i++) {
if (!XOpenDisplay(NULL)) {
printf("Went up to %d\n", i);
break;
}
}
return 0;
}