In Erlang/OTP the number of atoms you can create is limited to 1,048,576, and it's not garbage collected. It is stated in the gen_server
docs that atoms are not garbage collected, but I cannot find out if there is a limit.
Does Elixir have a limit as well? And if so what is it?
An atomic limit is a band structure admitting a set of exponentially Localized Wannier functions respecting all the symmetries of the crystal and possibly time reversal. When the atomic separation is taken to infinity, these Wannier functions coincide in most cases with localized atomic orbitals.
It is unknown how far the periodic table might extend beyond the known 118 elements, as heavier elements are predicted to be increasingly unstable. Glenn T. Seaborg suggested that practically speaking, the end of the periodic table might come as early as around Z = 120 due to nuclear instability.
No known element has more than 32 electrons in any one shell. This is because the subshells are filled according to the Aufbau principle. The first elements to have more than 32 electrons in one shell would belong to the g-block of period 8 of the periodic table.
There can be no more than 137 elements. This limitation of the number of elements follows from the fact that there is a maximum speed in the Universe. That is, from the limit of the speed of light in a vacuum... Content may be subject to copyright.
Elixir runs on the same virtual machine as Erlang, and it's thus subject to the same atom limits as Erlang.
You can check the current limit with :erlang.system_info(:atom_limit)
, and you can change the limit by passing the +t
flag to the Erlang virtual machine, using --erl
to let the flag through to Erlang:
$ elixir -e 'IO.inspect :erlang.system_info(:atom_limit)'
1048576
$ elixir --erl "+t 2000000" -e 'IO.inspect :erlang.system_info(:atom_limit)'
2000000
However, if you find yourself running out of atoms, you should probably try solving the problem in another way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With