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

Thomas Lindgren <>
Sat Nov 17 20:46:52 CET 2007


--- Raimo Niskanen
<> 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
OTP.)

Slides can be found at
http://www.erlang.se/workshop/2005/ew05_lindgren_talk.pdf

Best,
Thomas



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the erlang-questions mailing list