Megaco stack

Ulf Wiger (AL/EAB) <>
Thu Aug 26 10:34:33 CEST 2004

One fairly straighforward thing to try is to 
go through the following steps:

- Make a system, using the SASL tools 
  (systools:make_script()). This is a bit tricky 
  the first time, but you could try the following
  tutorial that I put together some time ago:

- Call systools:make_tar/2 using the same .rel file as
  in the first step. This is also briefly mentioned in the

  The manual shows you how to include a runtime system in
  the tar file. Unpacked, this file structure should give you
  an idea of how much space is required for your system 
  before doing any advanced stripping. The make_tar function
  will only include applications that have actually been 
  listed in the .rel file.

If you're lucky, this will be enough... I tried it, just to 
see whether there'd be any surprises (there was one: the 'erts'
option to make_tar() seems to require the OTP Root, and not the 
erts directory as the manual states.) My computer reports 38 MB
of disk space for a runnable system made out of kernel, stdlib
and megaco. Perhaps that's slightly more than you had in mind?

The majority of space is used by the following files:
- beam (7.18 MB)
- beam.elib (7.21 MB)
- beam.elib.shared (7.22 MB)
- beam.shared (7.18 MB)

I can't tell you whether all of them are needed.
A highly unscientific experiment suggests that you can at
least start the system on a Solaris box without beam.elib,
beam.elib.shared and beam.shared. That cuts down the space
requirement to ca 17 MB. Perhaps someone who knows what these
files actually do could tell you what you're giving up...

After this, I suggest you run xref to find out which modules
in stdlib and kernel are actually used by megaco. It's not 
going to give you much, though. There are also some more files
in erts/bin that you could perhaps do without, but it all depends
on how much you want to cripple your system in order to save a 
few megabytes of disk space (I know - the answer is not obvious
when it comes to embedded systems.)


> -----Original Message-----
> From: 
> [mailto:]On Behalf Of Guillermo
> Fernandez Castellanos
> Sent: den 26 augusti 2004 04:43
> To: 
> Subject: Megaco stack
> Hi,
> Accept my appologies if this message has been already sended 
> to the list...
> I am starting to look at Erlang, as I need a Megaco stack for 
> my job and 
> Erlang's one seems to be promising. The problem is, my boss ask me to 
> make it work in only a few Mb of disk space, and that's 
> largelly under 
> the 80 Mb of my Linux installation... I am using the latest Erlang 
> distribution. Is that possible? Or is an impossible dream? What would 
> (rough estimation, of course) be the minimal disk space requirements?
> I would apreciate any hint, link or help in that direction.
> I had a look to the Erlan FAQ, and finded the following references:
> 5.5 How do I write an Erlang system that fits on a floppy?
> Unfortunatelly this distribution does not give a lot of details about 
> the libraries that it includes, and Megaco does not seem to 
> be one of them.
> 8.9. Is Erlang small enough for embedded systems?
> """It is reasonably straightforward to fit Erlang itself into 
> 2Mbyte of 
> persistant storage"""
> """ This can be automated by editing and adding +compressed 
> +no_debug_info to the erlang compiler options and then rebuilding all 
> the libraries."""
> unfortunatelly I did not find it that straightforward nor was able to 
> find the file...
> After a
> $ grep -r '\-include' * |  awk 'FS="\"" {print $2}' | sort | uniq -u
> et/include/et.hrl
> megaco/include/megaco_sdp.hrl
> megaco/src/text/megaco_text_tokens.hrl
> megaco_ber_bin_drv_media_gateway_control_v1.hrl
> megaco_ber_bin_drv_media_gateway_control_v2.hrl
> megaco_ber_bin_media_gateway_control_v1.hrl
> megaco_ber_bin_media_gateway_control_v2.hrl
> megaco_ber_media_gateway_control_v1.hrl
> megaco_ber_media_gateway_control_v2.hrl
> megaco_per_bin_drv_media_gateway_control_v1.hrl
> megaco_per_bin_drv_media_gateway_control_v2.hrl
> megaco_per_bin_media_gateway_control_v1.hrl
> megaco_per_bin_media_gateway_control_v2.hrl
> megaco_per_media_gateway_control_v1.hrl
> megaco_per_media_gateway_control_v2.hrl
> i found that the dependencies seemed to rely little on the 
> OTP library. 
> I then thought about simply stripping (deleting...) the non used OTP 
> modules (applications) from the compiled Erlang distribution. But 
> something tells me it's not a good idea...
> Thanks,
> G

More information about the erlang-questions mailing list