[erlang-questions] Internal compiler atoms

Björn-Egil Dahlberg wallentin.dahlberg@REDACTED
Sat Jul 29 15:18:22 CEST 2017


All identifiers, i.e. variables and function names, are represented as
atoms internally in the compiler. In addition to your own variables,
temporaries are also generated in core and kernel. These are also
identifiers and therefor also atoms. This means we can't really predict how
many atoms will be generated either.

And No, there is no real need for these to be represented as atoms. It
would be better if they were binaries imho. I guess the original author(s)
of the compiler never expected huge a huge number of atoms being generated.

The remedy is to rewrite the compiler internals to use binary strings
instead of atoms for identifiers. That goes for the whole chain of things,
tokinizer, parser, linter, forms, core, kernel and beam. Happy hacking. :)

// Björn-Egil

2017-07-27 16:19 GMT+02:00 Håkan Mattsson <hawk.mattsson@REDACTED>:

>
> I am trying to compile a
> ​(​
> big
> ​)​
> module from a list of forms
> ​​
> , but it seems
> ​ like the compiler internally generates lots of new atoms:​
>
>
> no more index entries in atom_tab (max=1048576)
>
> Crash dump is being written to: erl_crash.dump...
>
> ​In this case the compiler itself generated ​more than 300K atoms while
> compiling my forms.
>> ​Why is the atoms generated?​
>
> ​Is this anything that can be disabled?​
>
> /Håkan
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170729/a19d6b19/attachment.htm>


More information about the erlang-questions mailing list