[erlang-questions] Why Beam.smp crashes when memory is over?

Robert Virding rvirding@REDACTED
Mon Nov 9 09:16:44 CET 2009


No.

There is a major difference between handling OOM in an OS and in the BEAM.
In an OS it usually at a per process level that memory runs out so it is
easy to decide which process to kill so that the OS can continue. In the
BEAM, however, it is the VM as a whole which has run out of memory not a
specific, it is. therefore, much more difficult to work out which process is
the culprit and to decide what to do. For example it might be that the
process which causes the OOM is not the actual problem process, it might
just the last straw. Or the actual cause may that the whole app might be
generating large binaries too quickly. Or it might be that the whole app is
spawning to many processes without any one process being the cause. Or ...
In all these cases killing the process which triggered the OOM would be the
Wrong Thing. We found that it was difficult to work out a reasonable
strategy to handle the actual cause so we decided not handle it.

"Don't catch an error which you can't handle" as the bard put it.

Robert

2009/11/9 Max Lapshin <max.lapshin@REDACTED>

> Yes, there are techniques to write watchdogs, but my question was: is
> it possible to prevent Erlang VM from crash?
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>


More information about the erlang-questions mailing list