[erlang-questions] eheap_alloc crash when using mnesia

Matthew Dempsky <>
Mon Oct 20 22:56:03 CEST 2008


On Mon, Oct 20, 2008 at 9:36 AM, Gleb Peregud <> wrote:
> As far as i know, this error appears when system runs out of memory.
> Unfortunately Erlang VM crashes when it's alloc() fails. imvho proper
> solution would be to kill offending erlang process :)

I'd love to see a more elegant solution for out-of-memory conditions,
but it seems difficult to recover from without explicit memory
allocation.  E.g., in C, you can check whether malloc(3) failed and
then fail gracefully, making sure your error handling code doesn't
need to allocate additional memory.  (Stack space is still implicitly
allocated, but I've never heard this to be a problem, except with
runaway recursive programs and kernel programming where the stack
space is more limited.)

Do any other programming languages with implicit dynamic memory
allocation have a better solution than simply terminating?



More information about the erlang-questions mailing list