ElixirSublime icon indicating copy to clipboard operation
ElixirSublime copied to clipboard

Multiple Erlang/Elixir processes leak

Open pzmi opened this issue 8 years ago • 11 comments

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:

elixirsublimeerr

pzmi avatar Nov 01 '15 13:11 pzmi

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 ~]$

2kodes avatar Nov 11 '15 08:11 2kodes

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

jmedding avatar Dec 02 '15 14:12 jmedding

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.

josevalim avatar Jan 21 '16 22:01 josevalim

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.

ducky427 avatar Feb 10 '16 12:02 ducky427

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 avatar Mar 23 '16 08:03 max-underthesun

@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.

josevalim avatar Mar 23 '16 08:03 josevalim

This fix works, thanks!

satyakrishnagorti avatar Apr 14 '16 11:04 satyakrishnagorti

@josevalim seems like issue with processes leak is fixed now - so could you please add this package as recommended on elixir-lang.org?

YurkoHoshko avatar Apr 20 '16 10:04 YurkoHoshko

@YurkoHoshko done, thank you!

josevalim avatar Apr 20 '16 21:04 josevalim

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.

cesarandreu avatar May 29 '16 10:05 cesarandreu

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.

alexandru-calinoiu avatar Jul 10 '16 18:07 alexandru-calinoiu