Application under VxWorks - looking for suggestions
Massimo Cesaro
massimo.cesaro@REDACTED
Tue Oct 7 10:51:29 CEST 2003
On Mon, 2003-10-06 at 11:34, Matthias Lang wrote:
> Massimo Cesaro writes:
>
> > I'm starting to cross compile Erlang for VxWorks, and I looking for tips
> > and hints to speed from people on the list who maybe already did
> > that.
>
> Last March, I was going through my HTTP logs and noticed someone who'd
> stumbled upon our site with this search string:
>
> "help I run VxWorks get me out of here"
>
> ;-)
Ugh! Unfortunately I cannot choose on this...
>
> > I'm looking for creating a stripped down version of Erlang and OTP
> > (there are a lot of goodies in OTP that I don't need) in order to
> > minimize RAM requirements,
>
> are you trying to minimise RAM or FLASH requirements? Stripping
> unused modules won't save any RAM unless you're loading modules you
> then don't use (why?), but it will save a lot flash.
Currently I have 4 MB of Flash and 8 MB of RAM. I understand that I'll
have the luxury of 16 MB of RAM, but won't hold my breath waiting for
it.
>
> We (corelatus) run Erlang on embedded hardware with no swap space. Our
> older systems "only" have 32Mbyte of RAM. The typical total RAM
> consumption of the Erlang VM running a fairly simple control
> application is 8Mbyte, with an OS-enforced maximum of 14Mbyte.
Can you elaborate on the concept of "fairly simple control application"?
My idea was to run just the Megaco stack with a pretty simple gateway
application.
>
> In other words: it's quite possible to run in 16Mbyte, but having more
> DRAM will let you be lazier.
>
> > Given that I will only use a small subset of stdlib, is it
> > safe to strip down the modules I don't need?
>
> Module calls can be arbitrarily obfuscated in Erlang, e.g. you could
> have code like this:
>
> apply(list_to_atom(lists:reverse("gnirts")), chr, ["hello", $e])
>
> there's no tool in the world that can untangle that. So there is no
> absolute safety. You can get relative safety by using the XREF tool
> which comes with Erlang.
Yes, that's what planned to do.
>
> To make our embedded system, I wrote a script which stripped the
> Erlang system. The result is about 1.2Mbyte of library .beams. I
> didn't use SAE at all, partly because SAE was in its infancy when I
> did the shrinking work and partly because we have enough flash so that
> we don't have to worry about space that much.
I think that with 4 MB of flash we have some margins as well. I
considered using SAE because it's documented and I'hoping will save
time.
>
> Matthias
Thank you for the tips!
Massimo
More information about the erlang-questions
mailing list