[erlang-questions] how: Removing atoms from the atom table

Thomas Lindgren thomasl_erlang@REDACTED
Sat Nov 17 20:46:52 CET 2007

--- Raimo Niskanen
<raimo+erlang-questions@REDACTED> wrote:

> To make this happen atoms would have to be reference
> counted
> and represented quite differently internally, or, 
> a global atom garbage collect would have to be
> implemented,
> and it would have to stop all processes while
> garbage collecting, or be very complicated and tag
> supcious atoms, make several incremental passes, and
> when
> very sure remove the atom. In other words not
> lightweight
> and not efficient (much work and small gain).
> But not entirely impossible.

I think the lack of garbage collection of atoms makes
writing some systems a bit unnatural. In addition to
not using list_to_atom/1 with abandon, you also have
to avoid certain library functions, be careful about
what code you load, etc. (All of these can introduce
more of the permanent space leaks we call atoms.) But
it should be said that in practice we still seem to be
doing okay without such a memory manager.

For a proposal somewhat different from what Raimo
mentions above, see my workshop paper 'Atom Garbage
Collection' at EW 2005. (One should however note that
it hasn't been implemented, much less implemented in

Slides can be found at


Never miss a thing.  Make Yahoo your home page. 

More information about the erlang-questions mailing list