[erlang-questions] reducing size of erlang

Andrew Harris andrew.unit@REDACTED
Wed Jul 16 01:48:46 CEST 2008


Hi Matt,

> Getting a basic, small Erlang down to 3MB is fairly straightforward.
> Is 3MB "really big". I don't know, you didn't give me any clues about
> what you were aiming for.
>
>  1. Add the +compressed and +slim flags to the build
>  2. Throw out all libraries you don't need.
>  3. Throw out all binaries you don't need.
>  4. Strip the remaining binaries.
>
> #1 is easily done by applying the attached patch (for R11, but the idea
> is the same) to a clean source tree. Clean means "before you run 'configure'".

Thanks for the useful information.  I was able to save around 30MB,
going from 70MB to around 40MB!  It fits on the gumstix now.  I am
stuck now on a problem that I'm not sure about.  I'm wondering if I
might not have cross compiled correctly?  I updated the directory path
in bin/erl to point to the correct place.  Could it be that there are
other symbolic links I should fix?

root@REDACTED:~/cross-compiled/bin$ ./erl
(no error logger present) error: beam/beam_load.c(1097): Error loading
module error_handler:
  use of opcode 124; this emulator supports only up to 115

{"init terminating in do_boot",{'cannot load',error_handler,{error,badfile}}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
root@REDACTED:~/cross-compiled/bin$


-andrew



More information about the erlang-questions mailing list