GNOME/X11: Too many open files; /var/cache/fontconfig/

Hi. Suspecting too many files open by GNOME/X11/font system?

Symptoms:

  • Current GNOME 47 + X11 (6 years old installation, up-to-date; current kernel 6.12.4-1-MANJARO #1 SMP PREEMPT_DYNAMIC).

  • GNOME shell extensions occasionally report Gio.IOErrorEnum: Error opening file ...: Too many open files. I have had around 21 gnome shell extensions, now down to 17, no error now. A few show CPU/memory/temperature stats, so probably reading from /proc, but nothing exotic.

    However, the following is the situation even after I disable all GNOME extensions, and even right after a reboot:

  • 220K files open

    lsof | wc
    lsof: WARNING: can't stat() nsfs file system /run/docker/netns/ingress_sbox
        Output information may be incomplete.
    lsof: WARNING: can't stat() nsfs file system /run/docker/netns/1-x8ym9ev36o
        Output information may be incomplete.
     220229 2366982 32613777
    
  • (unsure if docker matters here, but I haven’t used it for long and I’m happy to uninstall/re-install)

  • 169K files

    lsof | grep /var/cache/fontconfig/ | wc
    lsof: WARNING: can't stat() nsfs file system /run/docker/netns/ingress_sbox
    ...
     169074 1816182 26375544
    

I do have some extra fonts installed, but they shouldn’t be used right after the boot. Do they load automatically, and is there any way to make them loaded on demand only, or any way to throttle/limit that?

Please advise what else can be wrong, or how to investigate.

The here omitted file name could provide a clue as to what extension prompts the error.
All else is speculation. :man_shrugging:

The actual file (hat couldn’t be loaded) varied/rotated between the gnome shell extensions, depending on which extension was “hit” by the error.

Assuming the culprit: ttf-google-fonts-git package (1.9GB zipped?!). After I’ve uninstalled it, lsof | wc after a re-login (not even a reboot) shows 70054 757069 8626439.

I don’t know whether that is a meaningful figure or even whether it means anything.

For context here is the result of the same command right now here:

lsof | wc
 142485 1514562 20469166

what is wc without an option supposed to mean anyway?
lsof returns a lot of lines …

I think that suspicion is misplaced.
… down the wrong rabbit hole, so to speak …

“Word count”, whereby “word” is any chunk of data separated by whitespace. :wink:

Thanks, I knew that. :grinning:
In the context it is used here it produces a pretty meaningless number is what I meant to say.

2 Likes

How is a number of open files meaningless here, if the error says “Too many open files”? If you can’t help, don’t add noise, please.

The actual extensions that failed with that error, and the file it wanted to open, varied, but it was always a simple javascript file that was part of the extension.

I would like to point out that we like to discuss controversial technical topics. However, it is important to show respect to one another despite different opinions. Please pay attention to the tone of your contributions!

1 Like

To be constructive re this information:

on an older system, that default once was different, lower

Too many open files... need more file handles / Applications & Desktop Environments / Arch Linux Forums

and this could be the reason for the issue you ran into.

I had this in mind, but didn’t google it to give you that hint.
… now I did
I looked for: “too many open files arch” and this was the first hit.

See whether this was it.

1 Like