All my elixir projects slowly run out of memory

All my elixir projects slowly run out of memory.

Context
I have a couple of Elixir/Phoenix application with practically no load (5 visits per day).
This is a typical RAM usage for 2 days window. As you can see, it slowly rises to 1gb and then the instance dies. Before it dies the app is unavailable for some period, I presume because it can’t accept connections. Fly does not start another machine in this case and my app is simply unavailable without being under any load.

This is memory usage at the time of writing along with observer results. Total ram used ≈134 MB, when grafana shows that my fly.io instance occupies 600MB.

> :erlang.memory()
[
  total: 140845712,
  processes: 50693280,
  processes_used: 50687608,
  system: 90152432,
  atom: 1884521,
  atom_used: 1874421,
  binary: 2459264,
  code: 52042526,
  ets: 9434816
]

I am performing a number of tests, so I will extend this thread.

If you encountered this problem, please let me know what was the cause.

If you shell into the machine, and run free -h a few times over a few hours, do you see it eating memory? My first thought is that your Elixir application has a memory leak, and you’d need to deploy a cut-down version to find out where that leak is.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.