jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
828 stars 68 forks source link

Too many open files #96

Open weak-head opened 6 years ago

weak-head commented 6 years ago

After enabling asynchronous compilation

(use-package async
  :ensure t
  :demand t
  :init (setq async-bytecomp-allowed-packages '(all))
  :config (async-bytecomp-package-mode 1))

I'm having Too many open files for clean initialization from scratch:

Error (use-package): Failed to install magit: Failed to verify signature: file-error, "Creating process pipe", "Too many open files"
Error (use-package): Failed to install ssh-agency: Creating pipe: Too many open files
Error (use-package): Failed to install company-go: Creating pipe: Too many open files
Error (use-package): Failed to install go-eldoc: Creating pipe: Too many open files
Error (use-package): Failed to install google-this: Creating pipe: Too many open files
Error (use-package): Failed to install haskell-mode: Creating pipe: Too many open files
Error (use-package): Failed to install haskell-snippets: Creating pipe: Too many open files
Error (use-package): Failed to install hlint-refactor: Creating pipe: Too many open files
Error (use-package): Failed to install intero: Creating pipe: Too many open files
Error (use-package): Failed to install company-cabal: Creating pipe: Too many open files
Error (use-package): Failed to install cmm-mode: Creating pipe: Too many open files
Error (use-package): Failed to install helm: Creating pipe: Too many open files
...

Emacs 25.3.1, win10 enterprise

weak-head commented 6 years ago

Wikipedia states that SUA has been deprecated in Windows 8 and has been removed in Windows 8.1.

Looks like this is the reason why HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Services for Unix DWORD entry called MaxOpenFiles has no effect.

Is there any workaround for this or this is a limitation and there is not way to effectively use emacs-async on Windows?

jwiegley commented 6 years ago

I rather think that emacs-async needs a way to throttle the number of async processes it will ever create at one time.

kiennq commented 4 years ago

I have a little function advise that can be used to limit number of async processes. Share here if anyone need. https://gist.github.com/kiennq/cfe57671bab3300d3ed849a7cbf2927c

cpbotha commented 3 years ago

I have a little function advise that can be used to limit number of async processes. Share here if anyone need. https://gist.github.com/kiennq/cfe57671bab3300d3ed849a7cbf2927c

I was running into exactly this issue with your emacs-k scoop build @kiennq - on Windows 10 insiders developer channel (build 21382.1).

The code you have shared certainly helps with melpa updates, but it looks like I'm now running into the same issue with the native-compilation async compilation processes.

P.S. I ran into this code snippet which shows how to limit the number of compilation processes: https://ddavis.io/posts/emacs-native-centos7/#deferred-and-asynchronous-compilation (you have to prepend native- to the variables) and now emacs-k s eems to be running.

Thank you!