[erlang-questions] atom table limit & erlang shell
Thomas Lindgren
thomasl_erlang@REDACTED
Sat May 24 13:17:16 CEST 2008
--- Howard Yeh <hayeah@REDACTED> wrote:
> Hi,
>
> What happens if I exceed the atom table limit, and
> how would I know?
Why not try it? For example,
atom_killer() -> atom_killer(0).
atom_killer(N) ->
list_to_atom(integer_to_list(N)),
atom_killer(N+1).
(Running that on my mac gave a bus error and a crash
dump.)
> i am doing some code generation, which dynamically
> create maybe
> 2000~3000 new atoms (which are reused for later).
> Would that go over
> the limit?
No, the max number is 1048576.
http://www.erlang.org/doc/efficiency_guide/advanced.html
You can also see the amount of memory used for
different purposes with erlang:memory/1, for instance
erlang:memory(atom_used).
Best,
Thomas
More information about the erlang-questions
mailing list