Actually using MaxClients is very unstable
Finally restarted my X server with a higher MaxClients (2048), and tested it out.
First time, I ran 300 instances of kcalc. I got errors I didn't get a chance to save, followed by the X server crashing when I killed the kcalcs.
(EE) 0: /usr/bin/X (OsSigHandler+0x68) [0x11e4db518]
(EE) 1: linux-vdso64.so.1 (?+0x0) [0x7fffb0770498]
(EE) 2: /usr/bin/X (WriteToClient+0x84) [0x11e4da970]
(EE) 3: /usr/bin/X (XkbSendStateNotify+0x118) [0x11e4b5878]
(EE) 4: /usr/bin/X (_XkbApplyState+0x110) [0x11e4bff18]
(EE) 5: /usr/bin/X (XkbHandleActions+0x1c4) [0x11e4c3864]
(EE) 6: /usr/bin/X (XkbProcessKeyboardEvent+0x32c) [0x11e4c3dd0]
(EE) 7: /usr/bin/X (AccessXFilterPressEvent+0x3dc) [0x11e4b8a30]
(EE) 8: /usr/bin/X (ProcessKeyboardEvent+0x174) [0x11e4c3f78]
(EE) 9: /usr/bin/X (mieqProcessDeviceEvent+0x1e4) [0x11e3708e8]
(EE) 10: /usr/bin/X (mieqProcessInputEvents+0x214) [0x11e370b84]
(EE) 11: /usr/bin/X (ProcessInputEvents+0x24) [0x11e4fedb8]
(EE) 12: /usr/bin/X (Dispatch+0x64) [0x11e3a5534]
(EE) 13: /usr/bin/X (dix_main+0x490) [0x11e3aa694]
(EE) 14: /usr/bin/X (main+0x18) [0x11e57b57c]
(EE) 15: /lib64/libc.so.6 (generic_start_main+0x118) [0x7fffafd06210]
(EE) 16: /lib64/libc.so.6 (__libc_start_main+0x88) [0x7fffafd063f4]
(EE)
(EE) Segmentation fault at address 0x140083d01400847
Second time, I used 200 instances of xev (on top of ~96 that started with my session). No errors this time, but when I killall'd xev (all processes did end, and xrestop showed the client count drop), about 50 of their windows remained anyway. xkill is the only way I can seem to get rid of these dead windows.
Running 21.1.3
Edited by Luke Dashjr