Rich_Morin

Rich_Morin

Ways to keep coding errors from crashing the Erlang VM?

Although the Erlang VM is designed to be very robust in the presence of coding errors, there are still a few ways to crash it. How to Crash Erlang describes several of these:

  • Run out of atoms.
  • Run out of processes.
  • Flood the mailbox for a process.
  • Create too many large binaries in a single process.

This makes me wonder whether there might be ways to protect the VM against these (and other) categories of coding errors. For example, I could imagine ways to monitor use of limited resources, killing aberrant processes before they can crash the VM.

Can anyone help me to understand why this hasn’t been done, at least as an option for use in pre-production testing? ELIF…

-r

First Post!

D4no0

D4no0

The first issue can be averted easily: Don’t create new atoms at runtime, if you need string to atom conversion just use String.to_existing_atom.

Other issues except the mailbox flooding seem to be related to running out of memory issue, because in the case of processes while you have a limit set, you can increase it with a flag when starting the VM. Large binaries are stored in a shared memory space and processes have pointers to them, so I don’t think there is a limit to how many big binaries you can reference.

Where Next?

Popular in Questions Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New

Other popular topics Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement