Maximum number of clients reached Error: Can't open display: :0
Today it happened again: you try to open some program and nothing happens. Go to an open terminal, try again and it answers with the above message. Other days I used to reboot the session, but that's something I don't really think should be necessary.
First thought about X gone mad, but this one seems pretty well behaved:
$ lsof -p `pidof Xorg` | wc -l
5
Then noticed I had a long running chromium process (a jQuery page monitoring a remote service) so tried this one as well:
$ for a in `pidof chromium`; do echo "$a "`lsof -p $a | wc -l`; done
27914 5
26462 5
25350 5
24693 5
23378 5
22723 5
22165 5
21476 222
21474 1176
21443 5
21441 204
21435 546
11644 5
11626 5
11587 5
11461 5
11361 5
9833 5
9726 5
Wow, I'd bet you can guess next command
;-)
$ kill -9 21435 21441 21474 21476
This of course wiped out all chromium processes, but also fixed the problem. Suggestions for selective chromium killing welcome! But I'd better like to know why those files are not properly closed. Just relaunching chromium to write this post yields:
$ for a in `pidof chromium`; do echo "$a "`lsof -p $a | wc -l`; done
11919 5
11848 222
11841 432
11815 5
11813 204
11807 398
Which looks a bit exaggerated to me
:-(Syndicated 2016-04-25 08:20:38 from Ricardo Mones