[erlang-questions] High memory consumption inside docker

Michał Muskała <>
Tue Mar 29 14:01:04 CEST 2016

Hello everybody,

This is a followup from the elixir mailing list:
There were several issues involved in that particular problem, but one
of them might be of interest to the people here as well, as it's
generally erlang-related rather than tied to elixir or any package in

The issue comes down to unusually high memory consumption for erlang,
specifically the system part from erlang:memory/0. The output below
shows values when running outside docker and inside:

Outside docker:
erl -eval 'io:format("~w~n", [erlang:memory()]), init:stop().' -noshell

Inside docker's official erlang image (debian based)
docker run --rm -it erlang:18-slim erl -eval 'io:format("~w~n",
[erlang:memory()]), init:stop().' -noshell

Inside minimal alpine linux erlang image
docker run --rm -it msaraiva/erlang erl -eval 'io:format("~w~n",
[erlang:memory()]), init:stop().' -noshell

As you can see all the values except for system are very similar, with
system being almost 10x as large. The issue is also consistent across
different images. While outside docker a simple shell uses around
15MB, inside docker it grows to 80MB.
I tried to investigate the issue further using recon, and it looks
like the excessive memory is allocated with ll_alloc, although I have
to admit I'm out of my depth here.

I'll be thankful for any help or indications where I could dig deeper.


More information about the erlang-questions mailing list