ElixirSublime
ElixirSublime copied to clipboard
Multiple Erlang/Elixir processes leak
Erlang/Elixir process is being started when linter kicks in and is never released. With continuous usage multiple processes are being started and hang around until closing sublime or being killed.
Full process string:
/usr/lib/erlang/erts-7.1/bin/beam.smp -- -root /usr/lib/erlang -progname erl -- -home /home/dexior -- -pa /usr/lib/elixir/bin/../lib/eex/ebin /usr/lib/elixir/bin/../lib/elixir/ebin /usr/lib/elixir/bin/../lib/ex_unit/ebin /usr/lib/elixir/bin/../lib/iex/ebin /usr/lib/elixir/bin/../lib/logger/ebin /usr/lib/elixir/bin/../lib/mix/ebin -noshell -s elixir start_cli -extra /usr/bin/mix run --no-halt
System information:
$ elixir -v
Elixir 1.1.1
$ uname -a
Linux hostname 4.2.4-1-ARCH #1 SMP PREEMPT Fri Oct 23 07:32:38 CEST 2015 x86_64 GNU/Linux
Sublime Text 3 Build 3083 SublimeLinter and ElixirSublime installed via Package Control
Reproduction:
- mix project folder opened
- multiple Elixir files in tabs
- force linting, eg. do syntax error
- idle between forcing linting
Result:
any update on this? having similar problem. Also running Archlinux 64bit
[k@k ~]$ elixir -v Elixir 1.1.1 [k@k ~]$ uname -a Linux k 4.1.12-1-MANJARO #1 SMP PREEMPT Tue Oct 27 22:11:47 UTC 2015 x86_64 GNU/Linux [k@k ~]$
Also having this problem: $ elixir -v Elixir 1.1.1
$ uname -a Linux 14 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Why is the --no-halt
option being given? That's very likely the source of the problem. If you are sure you need to run with something like --no-halt
, I would recommend replacing it by:
-e "Task.async(IO, :read, [:stdio, 1]) |> Task.await"
This will hold it running until stdio closes which should happen when sublime closes.
I am also experiencing this issue.
➜ ~ elixir -v
Erlang/OTP 18 [erts-7.2] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]
Elixir 1.2.0
➜ ~ uname -a
Linux developer-XPS-8700 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Atleast for me, this package is unuseable because of this issue.
I had the problem with multiple processes, and solve it with @josevalim advise. What I did was opened the file:
/home/user_name/.config/sublime-text-3/Packages/ElixirSublime/elixir_sublime.py
and edited line 177 (in my case).
Before edit:
self.process = run_mix_task('run --no-halt')
After edit:
self.process = run_mix_task('run')
I am not sure if this could cause any troubles in the future, but for now the problem is solved and I have no more memory leaking. If @vishnevskiy or @josevalim (or someone else smart enough, because I am just a beginner) could comment this - that would be nice.
Thanks for package! (And for Elixir of course :) )
@max-underthesun can you please send a pull request?
At this moment, we have stopped recommending this package for Sublime because of this issue, so it would be nice to see it fixed and a new version released.
This fix works, thanks!
@josevalim seems like issue with processes leak is fixed now - so could you please add this package as recommended on elixir-lang.org?
@YurkoHoshko done, thank you!
To anyone that finds this issue, you'll need to do "Package Control: Add Repository", and paste in https://github.com/vishnevskiy/ElixirSublime
. The version that's in package control is outdated.
I think this issue can be closed now.
The update solves the problem for me running elixir 1.3 on a linux machine I was getting fork: retry: No child processes
when trying to launch new apps.
Took me a while to track it down do this plugin, since I am learning the language I was thinking that I might mess something up.