Today I Learned

Atom exhaustion

Recently I've stumbled upon problem with atom exhautiion limit in Erlang memory.

New atoms are added to atoms table stored in memory which is not cleaned by garbage collector and this may lead to exceeding defined limit, which by default is set to 1_048_576.

How to deal with this?

Instead of using String.to_atom/1 use String.to_existing_atom/1.