Can Erlang process IDs be "run"?

The answer to this question says that Erlang PIDs are actually 28-bit integers, the first 10 of which are a node number (always 0 for a local node), and the next 18 of them are an index in the global process table. So, if my understanding is correct, assuming we are working with only one node, the maximum number of unique pids is 2 ^ 18 or about 262,000. Is this the maximum number of processes I can create on one Erlang node over time? If I have a very long Erlang node, will the VM crash immediately after I lay out my 2 ^ 18 + 1'th node, or will the old, unused pid be reused? If so, how is this process implemented at the vm level?

+3


source to share


1 answer


the answer to another question seems to refer to an earlier version of the Erlang runtime, it changed after R9 (R17 is the latest at the moment). According to the implementation , the process ID uses 28 bits to determine the internal IDs .

Pids are returned when the process dies and any monitors have been notified, so 2 ^ 28 is the upper limit for the number of concurrent processes per node.



Process default limit is 2 ^ 18, and can be extended with the option +P

to erl

see. Documentation erl .

Note: the documentation states that the upper limit is 2 ^ 27 processes, which is not in line with the code.

+1


source







All Articles