Increase RLIMIT_NOFILE limit
The compositor can easily exceed the soft file descriptor limit, it makes sense to bump the soft limit to the hard limit, which is usually 512K with systemd.
- sway PR: https://github.com/swaywm/sway/pull/6629
- mutter MR: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2235
- golang discussion: https://github.com/golang/go/issues/46279
Hitting the soft limit, might be a potential reason why plasma sometimes crashes. https://bugs.kde.org/show_bug.cgi?id=447717
The only problem is that RLIMIT_NOFILE can leak to child processes. It can be a problem when using select(). Since kwin launches only Xwayland and potentially an input method, it's probably not a big problem and we could not restore the RLIMIT_NOFILE limit.
See also http://0pointer.net/blog/file-descriptor-limits.html
Edited by Vlad Zahorodnii