Closed jiacai2050 closed 1 year ago
Frequently see the same problem (too many open files) using lsp-mode with gopls in a large repository.
I added this to the nightlies yesterday. There are 2 builds that have this enabled:
Running the ulimit in scratch buffer gets me:
(shell-command-to-string "ulimit -a")
"core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 7168
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 9792
cpu time (seconds, -t) unlimited
max user processes (-u) 10666
virtual memory (kbytes, -v) unlimited
"
I'd like to know if this fixes the LSP problems (I haven't seen that but I tend to work on smaller codebases).
Thanks. I'll start using the 06-29 build now and report back. Unfortunately, it often takes a few days of use before it shows up. With the upcoming US holiday, that won't be quite so immediate.
Recording my ulimit after the update (macOS Monterey 12.6.6):
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 9788
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 5568
-n: file descriptors 7168
I've flipped back to 28.2, as something in the dailies kept making Emacs unresponsive.. I don't think it was the open-files change, but I was not able to narrow the problem.
I added this to the nightlies yesterday. There are 2 builds that have this enabled:
* https://emacsformacosx.com/emacs-builds/Emacs-2023-06-28_13-01-07-d6bcb39ba9d46f7dc29e01551a1d35fe250695a9-universal.dmg * https://emacsformacosx.com/emacs-builds/Emacs-2023-06-29_00-09-24-d6bcb39ba9d46f7dc29e01551a1d35fe250695a9-universal.dmg
Running the ulimit in scratch buffer gets me:
(shell-command-to-string "ulimit -a") "core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 7168 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) 9792 cpu time (seconds, -t) unlimited max user processes (-u) 10666 virtual memory (kbytes, -v) unlimited "
I'd like to know if this fixes the LSP problems (I haven't seen that but I tend to work on smaller codebases).
Would it be possible to get an image with Emacs 29.1 and these build flags, the nightly/30.x images have other issues and I'd like to test drive this change. I basically run into this issue a few hours after opening Emacs since I have multiple lsp servers running for independent projects.
@noc0lour - Have you checked the 29.1 build? I'm seeing 7168 file descriptors, similar to what I was seeing with the earlier dailies..
Will return
The max open files is hard-coded in Emacs as 1024, I write a blog post explaining how to fix this, would you mind adding them to default build options?