ElixirLS Running two instances on Vscode
See original GitHub issueProblem
ElixirLS runs two instances on my Vscode. They both do exactly the same work at their own pace, maxing out my CPU usage all the time. I can see two beam.smp
instances in my Mac’s Activity Monitor Panel, and likewise two ElixirLS
instances in Vscode’s Output panel where extensions display their logs.
Even when seemingly doing nothing (logs don’t show any new entries), they both keep maxing out my CPU.
The logs on both start with:
Started ElixirLS v0.5.0
Elixir version: "1.10.3 (compiled with Erlang/OTP 22)"
Erlang version: "22"
ElixirLS compiled with Elixir 1.7.4 and erlang 20
The logs appear constantly identical, except the times to compile files are slightly different, indicating they are indeed two different instances doing the same things at the same time.
mix.exs
dependencies also have {:dialyzex, "~> 1.2.1", only: [:test, :dev]},
, in case that is anyhow relevant.
I’m using asdf
with the following content in my .tool-versions
:
elixir 1.10.3-otp-22
erlang 22.3.4.1
nodejs 11.15.0
Environment
- Elixir & Erlang versions (elixir --version): Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] Elixir 1.10.3 (compiled with Erlang/OTP 22)
- Operating system: macOS Catalina 10.15.6 (just installed a major update)
- Editor: VSCODE
- LSP Client name: ElixirLS: Elixir support and debugger
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:26 (12 by maintainers)
Top GitHub Comments
Just chiming in to echo that ~6 months later, the advice above still applies. I also got this and was able to resolve by just closing open “unsaved” editor windows and restarting.
In the top left of VSCode, it will tell you how many unsaved open editors you have:
I used this little window to guide my hunt. After closing all unsaved tabs and restarting VSCode, I only had one ElixirLS running.
Got it!
Steps to reproduce (shortcuts are for Linux, not sure what they are for mac):
mix new double_double
cd double_double
code .
(or launch VScode however you normally do)ctrl+k ctrl+h
)ctrl-n
)ctrl-k m
)Quitting the editor in this state and re-launching it using
code .
restores unsaved files, and the restoration of those files launches a secondary ElixirLS process. I keep unsaved files around for long periods of time sometimes, and this is why the double-process thing has been bothering me for quite a while 😉 .