xlsclients
and xrestop
didn't tell me much, either. Most writeups of people researching this problem focus on finding the total open Unix sockets. But the lsofc -c Xorg
advice is much better.
However, you can use ss
to get at that info more directly these days. This command shows me the unix (local) sockets connecting to Xorg:
sudo ss -x src "*/tmp/.X11-unix/*"
You might need to experiment with the filter part to get it to work on your environment. Experiment with sudo ss -x
alone to see everything and try to filter from there.
I can't find a way to have ss
identify the source app (like lsofc
does) but with a few pipes I can get to this:
sudo ss -x src "*/tmp/.X11-unix/*" | grep -Eo "[0-9]+\s*$" | while read port
do sudo ss -p -x | grep -w $port | grep -v X11-unix
done | grep -Eo '".+"' | sort | uniq -c | sort -rn
Output looks like this:
8 "slack"
8 "code"
7 "brave"
5 "kded5"
2 "kwin_x11"
2 "ksmserver"
2 "kscreen_backend"
1 "zoom"
1 "zim"
:
When I ran this while getting the "Maximum number of clients reached" problem, this search turned up a list of 256 clients. So I'm pretty confident that this is the right tool to find the culprit.
You can find out more about ss
at these pages:
Here's a commented version of that gnarly script line:
sudo ss -x src "*/tmp/.X11-unix/*" | # List X11 sessions
grep -Eo "[0-9]+\s*$" | # extract the port number
while read port ; do # For every connected port
sudo ss -p -x | grep -w $port | # Find the connecting process
grep -v X11-unix # but ignore the x11 side
done | grep -Eo '".+"' | # extract process names
sort | uniq -c | # Count the number of repeats
sort -rn # And sort them descending by count
lsofc -c Xorg
with thelsofc
at Who's got the other end of this unix socketpair? – Stéphane Chazelas Dec 22 '15 at 14:29Maximum number of clients reached
message? – Stéphane Chazelas Dec 22 '15 at 15:00konsole
window open, I try to launch an app form there. That's when I get the error. BTW, feel free to post your original comment as an answer, I think it got me far enough to nail the culprit ( the slack app ) – Robert Munteanu Dec 26 '15 at 22:43