Linux: Too many files open
I’m a happy Linux desktop user and running Zorin OS 16.2. Every now and then some Gnome extensions stop working without any error message. I found out what happens.
I had noticed several times that some of my Gnome extensions stopped working. It seemed to happen randomly
and I couldn’t find an explanation for the cause.
Until I checked the plugins in the Extension Manager:
Apparently, multiple plugins ran into an error: “Too many open files”.
Searching for “gnome extensions too many open files” in Google led me to find an How-To Geek  article that handled the exact same issue and clearly explains the cause and remedy.
In short: Linux has a limit on how many files are allowed to open, by default 1024.
1024 doesn’t directly sound like a small amount if you consider how many files users explicitly open, like for example in a text editor. But when using many webbrowser tabs and one or more IDE’s which index lots of files, this number suddenly feels much smaller.
ulimit, you can check the soft limit:
$ ulimit -n 1024
The limits can be modified by editing 2 files:
$ sudo nano /etc/systemd/system.conf $ sudo nano /etc/systemd/user.conf
In both files, modify the line containing:
- #DefaultLimitNOFILE + DefaultLimitNOFILE=4096:524288
This modifies the 1024 limit to 4096.
After a reboot, my Gnome extensions were working again. Time will tell if the problem is resolved with this value…
See below link for more detailed information about this issue and the solution to it.
 How-To Geek - How to Solve the “Too Many Open Files” Error on Linux
January 19, 2023