report browser and error_logger

Francesco Cesarini francesco@REDACTED
Thu Jan 10 00:45:42 CET 2002

Atoms are not garbage collected in the system, so for every atom you 
create, you will be allocating a few bytes that are never released.

To solve your problem, the first solution that comes to my mind is an 
ets table where you you retrieve and store the pids of the dynamic 
processes, and if the traffic is not too intensive, a name server on 
every node.

The only processes you should register are unique ones which handle a 
single task in the system. The rule of thumb is that if several 
processes run the same code, then they should not be registered.


Martin J. Logan wrote:

>    I have a question about atoms. I realize that it is not a good idea to use
>list_to_atom to create atoms dynamically. I have a situation in which I need to
>communicate with a spawned process on a remote node. I can have thousands of
>these processes.  The  knee jerk solution that I came up with was to locally
>register each spawned process and then send across the net its registered name
>and node. The receiving process can then {name, node} ! message  the remote
>process. Are atoms ever cleaned up? I thought that when a process dies that all
>atoms associated with it would be destroyed. I am getting atom_tab filled
>errors. Does anyone know how the atom table is dealt with and if atoms are
>around for the life of the node could someone suggest a good solution for
>talking to these individual processes across nodes?
>            Thanks,
>            Martin

More information about the erlang-questions mailing list