<div dir="auto"><div>You must have mis-understood what I wrote.</div><div dir="auto"><br></div><div dir="auto">It is not my program that generates all those atoms. They are generated internally by the compiler while it is compiling my program from forms. The atoms my program are using do already exist in the forms data structure.<br><br><div data-smartmail="gmail_signature" dir="auto">I am very well aware of the +t flag. But it is quite boring to set it to 100M just to be able to compile. As I do not understand why the compiler dynamically generates all these internal atoms I cannot predict how big the atom table needs to be. In my latest run the compiler actually generated 25M atoms (which is 25 times the default size of the atom table). It surprised me.</div><div data-smartmail="gmail_signature" dir="auto"><br></div><div data-smartmail="gmail_signature" dir="auto">Please, do not come up with further suggestions about avoiding explicit creation of atoms in general. My question was much more specific.</div><div data-smartmail="gmail_signature" dir="auto"><br>/Håkan<br></div><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Jul 28, 2017 08:43, "Albin Stigö" <<a href="mailto:albin.stigo@gmail.com">albin.stigo@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1. Try to avoid dynamically creating new atoms.<br>
<br>
2. But I need to! Goto rule 1.<br>
<br>
3. Dynamic atoms are not safe for long running code. You will<br>
eventually exhaust the atom table and this will lead to subtle bugs.<br>
<br>
4. If you really DO need to create dynamic atoms for a quick and dirty<br>
hack, keep in mind that atoms with a common prefix ie. foo_1, foo_2,<br>
foo_3 etc will lead worse performance because of how erlang compares<br>
atoms (some Erlang guru correct me if I'm wrong but this used to be<br>
the case).<br>
<br>
<br>
--Albin<br>
<div class="elided-text"><br>
<br>
On Fri, Jul 28, 2017 at 8:23 AM, Valentin Micic <<a href="mailto:v@pharos-avantgard.com">v@pharos-avantgard.com</a>> wrote:<br>
><br>
> Is this anything that can be disabled?<br>
><br>
> Say that there is, very soon you would be asking: why is there a limit on a<br>
> number of atoms?<br>
> Instead, you should write a code that does not generate 700k atoms.<br>
><br>
> V/<br>
><br>
><br>
</div>> ______________________________<wbr>_________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
><br>
</blockquote></div><br></div></div></div>