emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Surprisingly high use of file descriptors


From: Eli Zaretskii
Subject: Re: Surprisingly high use of file descriptors
Date: Thu, 05 May 2022 10:47:26 +0300

> From: Robert Pluim <rpluim@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 05 May 2022 09:13:27 +0200
> 
>     Stefan> Why would ``lsp-mode` or `eglot` consume anywhere near 1024 file 
> descriptors?
>     Stefan> Are they launching a separate LSP server process per buffer?
> 
> They use filenotify.el to watch for the changes to all the files in
> their project, which on some platforms consumes a file descriptor per
> file (at least macOS, and anything kqueue based like FreeBSD). On
> other platforms it uses one per directory, and Iʼm sure people have
> codebases with >1024 directories.

FTR, on MS-Windows the implementation uses a file handle per watch
(one watch for each directory), but that handle is not monitored by
the emulated pselect.  It also creates one thread per each watch.  The
maximum number of file handles per process on MS-Windows is AFAIK very
large (in the millions), and the maximum number of threads per process
is on the order of tens of thousands.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]