nimsuggest is consuming too much of CPU, fans have not stopped since I installed it via choosenim. In fact it uses more CPU than any other process.

Nim Compiler Version 0.20.0 [Linux: amd64]
Compiled at 2019-06-06
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: e7471cebae2a404f3e4239f199f5a0c422484aac
active boot switches: -d:release
Are you using VS Code? If so that's the fault of the VS code Nim extension. It spawns Nimsuggest far too aggressively.
I don't think VS Code has anything to do, I mean it might be aggressive but here we are talking of full CPU spinning.. there has to be something wrong.
There are multiple issues with nimsuggest.
Like OP said, in some cases, nimsuggest just keep spinning, and eat all CPU and need to be killall regularly. I've noticed it happened often while I'm in a middle of a macro. Worse, on Windows that will lock the file and causes issues with git.
Like dom96 the VScode Nim extension is very aggressive because it spawns one nimsuggest per file instead of per module which means that combined with 1 multiple instances of nimsuggest can be stuck at 100%
The only way to make nimsuggest work for me in the large project is to spawn nimsuggest as aggressively as possible and then kill it every 3 minutes. Only them I can get any suggestions out of nimsuggest.
Nowadays, VSCode nim plugin comes with useful setting: nimssugestResetTimeout.
Patterns when nimsuggest eats up a lot of memory or CPU time when left alive for sometime I have seen countless times.
Just to be clear: I'm not excusing nimsuggest here. But the way the VS Code extension launches nimsuggest is incredibly infuriating.
We should move to a Language Server that can manage nimsuggest instances in a sane manner.
btw for some reason it's not happening anymore lately!
(I pull devel quite often.)
JFYI setting nim.project in the workspace config helps:
{
"nim.project": [
"src/norm.nim"
]
}
Hi, nimsuggest (spawned by vscode-nim) just ate 4 GB of RAM on my Windows 7 and constantly uses 100% of one of the cores. So is there some memory leak, that should be fixed?
@sinkingsugar might be related to https://github.com/nim-lang/Nim/pull/11849. That caused infinite loop in macros.
@anurbol, it's probably not a memory leak as CPU usage is high as well, probably loop that keeps burning CPUs and allocating, in a similar vein to https://github.com/nim-lang/Nim/pull/11849. Anyway that's what this issue is tracking.
This issue still persists, I have noticed when working with HTTP server, if there is an issue in the code the nimsuggest process responsible for that file won't get killed even after the code has been fixed, I end up killing it manually.
Yes, I have it quite often as well, and I'm not working with macros or a heavy generics codebase.
Most helpful comment
Just to be clear: I'm not excusing nimsuggest here. But the way the VS Code extension launches nimsuggest is incredibly infuriating.
We should move to a Language Server that can manage nimsuggest instances in a sane manner.