[erlang-questions] Building small erlang vm suitable for bundle with app.

Matthias Lang matthias@REDACTED
Thu Dec 15 01:35:17 CET 2011


On Monday, December 12, wrp wrote:

> However, http://www.erlang.org/faq/implementations.html says
> 
> "A 2 MB stripped Erlang system can include the beam emulator and
> almost all of the stdlib, sasl, kernel, inets and runtime_tools
> libraries, provided the libraries are compiled without debugging
> information and are compressed..."
> 
> Are there detailed directions anywhere on building such small
> distributables?

That part of the FAQ was written about 10 years ago, when erts was
smaller than it is today. It's still possible to get below 3M without
pulling wild tricks, e.g. on an ARM system I have

   # du
   24      ./bin
   1019    ./lib
   1480    ./erts-5.8.4/bin
   1480    ./erts-5.8.4
   2523    .

Full list of files below.

The shrinking is done by judicious use of 'rm', plus this hack:

  http://erlang.org/pipermail/erlang-questions/2011-June/059489.html

Matt

--------------------
# ls -lR
.:
drwxrwxr-x    2 root     root             0 Dec 13 16:03 bin
drwxr-xr-x    3 root     root             0 Dec 13 16:03 erts-5.8.4
drwxr-xr-x    2 root     root             0 Dec 13 16:03 lib

./bin:
-rwxr-xr-x    1 root     root           857 Dec 12 15:00 erl
lrwxrwxrwx    1 root     root            25 Dec 13 16:03 run_erl -> ../erts-5.8.4/bin/run_erl
lrwxrwxrwx    1 root     root             6 Dec 13 16:03 run_test -> ct_run
-rwxr-xr-x    1 root     root          1159 Dec 12 15:00 start
-rw-r--r--    1 root     root          5372 Dec 12 15:00 start.boot
-rw-r--r--    1 root     root          6350 Dec 12 15:00 start.script
-rwxr-xr-x    1 root     root          1259 Dec 12 15:00 start_erl
-rw-r--r--    1 root     root          6535 Dec 12 15:00 start_sasl.boot
lrwxrwxrwx    1 root     root            24 Dec 13 16:03 to_erl -> ../erts-5.8.4/bin/to_erl

./erts-5.8.4:
drwxr-xr-x    2 root     root             0 Dec 13 16:03 bin

./erts-5.8.4/bin:
-rwxr-xr-x    1 root     root       1411656 Dec 12 15:00 beam
-rwxr-xr-x    1 root     root          9304 Dec 12 15:00 child_setup
-rwxr-xr-x    1 root     root           857 Dec 12 15:00 erl
-rwxr-xr-x    1 root     root         35168 Dec 12 15:00 erlexec
-rwxr-xr-x    1 root     root         32624 Dec 12 15:00 inet_gethost
-rwxr-xr-x    1 root     root         16068 Dec 12 15:00 run_erl
-rwxr-xr-x    1 root     root          7980 Dec 12 15:00 to_erl

./lib:
-rw-rw-r--    1 root     root         63577 Dec 12 15:00 erts-5.8.4.ez
-rw-rw-r--    1 root     root        311423 Dec 12 15:00 kernel-2.14.4.ez
-rw-rw-r--    1 root     root         39390 Dec 12 15:00 sasl-2.1.9.4.ez
-rw-rw-r--    1 root     root        628179 Dec 12 15:00 stdlib-1.17.4.ez



More information about the erlang-questions mailing list