-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% CPU usage and freeze in project with thousands of files #6000
Comments
I debugged it a little bit more:
|
Added this to (setq lsp-go-gopls-server-args '("-logfile" "/Users/jeiwan/.tmp/gopls.log" "-vv" "-debug" ":8080")) The log file is empty and there's nothing interesting on the debug server. |
Alright, I found the cause. That project has 170+ thousand files (not related to Go). When Emacs opens it, it starts analyzing them or maybe caching or maybe indexing – and this is when it hangs. I installed Doom at commit 42d5da8. When I opened the project, it showed me this message:
When choosing At commit 79c1fce, everything works without any issues and it doesn't ask about watching files. It seems that a module was added that scans/analyzes/watches all files in a project and it just cannot handle so many files. If so, the question is: how to ignore those files? (They're ignored in |
What is the value of (setq-hook! 'go-mode-hook
lsp-enable-file-watchers nil) |
@jeetelongname Thanks for pointing this out! However, I do need the watchers, so I simply added the cache folder to ignored ones: (with-eval-after-load 'lsp-mode
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]cache\\'")) |
What did you expect to happen?
Doom Emacs doesn't freeze when working with Golang.
What actually happened?
When I open a Golang project, Doom Emacs freezes consuming 100% of CPU. I don't need to do anything, just open a Golang file. This lasts very long so I eventually had to kill it because it's unusable.
This whole project was programmed in Doom Emacs and everything had been ok until I updated Doom and Emacs a couple of days ago (I had an old version of Doom, maybe more than 6 months old).
This is a fresh install: Emacs 27.2, latest Doom. The only changes in
init.el
are uncommentedgo
andlsp
modules. There are no logs or error messages.Describe your attempts to resolve the issue
It looks like it's indexing my project and its dependencies for autocompletion (I guess). The fact that it's Emacs that uses 100% CPU, not
gopls
, makes me think that.The issue doesn't happen when
go
andlsp
packages are not installed.Steps to reproduce
brew install --cask emacs
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
init.el
, uncommentgo
andlsp
modules.~/.emacs.d/bin/doom sync
anddoom/reload
.System Information
https://pastebin.com/rimY6Bre
The text was updated successfully, but these errors were encountered: