[erlang-questions] Erlang on ARM

Richard O'Keefe <>
Tue Feb 14 00:17:47 CET 2012


On 14/02/2012, at 3:55 AM, Frank Hunleth wrote:
> Right. Linux is usually set up to overcommit memory by default. Take a
> look at /proc/sys/vm/overcommit_memory to change this.

Yeah, we know about that.  (Isn't <a certain famous search engine>
wonderful?)  However, you have to be root to change that, and my
colleague doesn't want to distribute software that requires people
to change their OS parameters as root.  I can't say I blame him.

> I thought that
> Android also had a more sophisticated low memory handling policy, but
> I do not know for sure. At least with "regular" Linux, when a low
> memory situation occurs, the OOM killer runs a heuristic that will
> pick the sacrificial process to shut down.

The problem is that it seems to be really really stupid at making
those choices, killing system services with small memory use.
> 
> I have had problems with the OOM killer, but not with Erlang. I'm new
> to the Erlang world, though. I most recently ran into the problem with
> a Javascript interpreter that was embedded in a low memory device. It
> was possible to limit the amount of memory allocated by the
> interpreter and that addressed the issue.

Of course my colleague can limit the amount of memory he asks for.
He does.  However, living within that limit doesn't stop his
process being killed if *some other* process decides to ask for
a lot of memory.

The best we've been able to come up with is to have two processes.
One of them does the real work.  Each of them polls the other
and if there's no response, restarts it.  This relies on the
OOM-killer killing just one process, of course...

> Also, since you mentioned that you were looking into running on the
> Beaglebone, I have been running Erlang on that board as well. I've
> made a small SD card image (code on GitHub) that may help get you past
> the cross-compiling and other challenges of running on the board. I
> have some instructions here:
> 
> http://nerves-project.org/gettingstarted.html

I am very thankful to you for this.  This is a _great_ list.




More information about the erlang-questions mailing list