`mix local.hex` consumes all memory


Using mix local.hex consumes all memory, and eventually the machine needs to be reset. Using the --force switch doesn’t help either. Didn’t want to open an issue yet, because I may be just missing something entirely, but couldn’t find much in the docs.

In the other (meanwhile deleted) thread, you said you were using nix. Can you please tell us more about your system? I’ve never seen similar issues, but as far as I know nix requires you to do some things differently.

Ps: elixir and Erlang versions used when the problem occurs might be if special interest for us.


I assumed that it is probably specific to my setup, because I didn’t find any issues or posts about it either. The weird thing is that this only happens (ca. 7 time out of 10) when installing Hex in any way:

mix local.hex
mix archive.install git https://github.com/hexpm/hex tag "v0.20.1"

Once Hex is installed, all other global installs to MIX_HOME seem to work (e.g., Phoenix, Rebar). I kinda solved it by committing the installed Hex into version control. (Couldn’t find an .ez archive file for it online, and didn’t have the time to figure out how to create it.)

The specs of my system in case it is helpful to anyone:

  • NixOS 19.03
  • Elixir 1.9.0
  • Erlang/OTP 21 [erts-]
  • Nix script (pinned to the latest commit at the time of writing this)
  • Hardware: ThinkPad T520 (8 GB RAM, 8 GB page)

Anyway, thank you NobbZ!

1 Like