[erlang-questions] Internal compiler atoms

Albin Stigö <>
Fri Jul 28 08:43:34 CEST 2017


1. Try to avoid dynamically creating new atoms.

2. But I need to! Goto rule 1.

3. Dynamic atoms are not safe for long running code. You will
eventually exhaust the atom table and this will lead to subtle bugs.

4. If you really DO need to create dynamic atoms for a quick and dirty
hack, keep in mind that atoms with a common prefix ie. foo_1, foo_2,
foo_3 etc will lead worse performance because of how erlang compares
atoms (some Erlang guru correct me if I'm wrong but this used to be
the case).


--Albin


On Fri, Jul 28, 2017 at 8:23 AM, Valentin Micic <> wrote:
>
> Is this anything that can be disabled?
>
> Say that there is, very soon you would be asking: why is there a limit on a
> number of atoms?
> Instead, you should write a code that does not generate 700k atoms.
>
> V/
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>


More information about the erlang-questions mailing list