luechtdev
On my development VM (specs see below) - starting an elixir / erlang container takes up 2G of physical memory while running iex locally only takes up a few MB.
I only started an empty container with no modules loaded or code executed.
When more containers are started beyond the memory capabilities of the host, running Beam VM’s running in other (running) containers crash for the new instance to start.
Image of docker running with htop and system info (dev-vm)
observer_cli showing the memory usage
While memory usage is highly alarming on its own, other docker hosts are able to start the container with normal / reasonable memory consumption.
Production server running empty elixir container with normal memory usage
(Both instances running the same docker run -it elixir)
Other users could reproduce the problematic memory usage with the Ubuntu Desktop (kernel v5.15) but Ubuntu Server (kernel v6.4) is supposedly running just fine.
(Both running docker 24.0.2)
So far I tried:
- running different versions of the image
elixir:slim,elixir:alpine, … - limiting memory usage on docker → container crashes with errno 137 (out of memory);
- checking for swap → swap is disabled on both devices;
- running different versions of docker;
Any ideas on this problem would be apreciated since I’m unable to narrow down this problem to a Beam / Docker / OS / kernel level.
Kind Regards, Jannus
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
LostKobrakai
I’d be curious how
hexpm/elixirimages fare. They’re imo the much more useful images over theelixirones.D4no0
Is this true for a downgraded version of OTP, lets say OTP-25?
everte
Just a quick test:
docker run --name elixirhexpm --rm -it hexpm/elixir:1.15.4-erlang-26.0.2-debian-buster-20230612-slimMemory usage is 5MB; then I ran
iexin the container. Memory usage is 2GB.hexpm/elixir:1.15.4-erlang-25.3.2.4-debian-buster-20230612-slim(so OTP 25) has the exact same issue, but funny enough the memory usage is 1.5GB in stead of 2.0GB.I had some screenshots as well in the (closed and duplicated topic): Elixir docker container very high memory usage
D4no0
I ran this on a ARM instance server and it uses less than 5 MB, maybe there is a problem with hardware?
everte
I think with only 5MB you forgot to run
iex:).As said: I cannot reproduce it everywhere. My desktop has this issue, but my linux vm/vps server cannot reproduce it. So there is definitely something else (docker, containerd, linux kernel, ??) that affects this issue. I have only tested on amd64.
But @luechtdev obviously has the same issue on some of his linux systems.
D4no0
I’m not a linux master to understand how to correctly get the memory usage, however from my 8GB instance, it is using 1.6% with IEX opened, witch should be roughly 128 MB.
everte
I check the memory usage with
docker stats.Anyway, when limiting the memory to 500M (which should be plenty for just an iex sesison) the container immediately crashes:
From dmesg on the host:
D4no0
Here you go:
everte
I created a new (arm) vm with fedora 38 and can reproduce it there as well (seems that fedora 38 seems to be one of the distros with new enough kernel/containerd/etc to reproduce).
docker run --name elixirhexpm --rm -it hexpm/elixir:1.15.4-erlang-26.0.2-debian-buster-20230612-slim iexD4no0
Yeah I’m running ubuntu: