[erlang-questions] Actor garbage collection
Thu Nov 4 15:19:31 CET 2010
No, processes are never removed until they are explicitly killed. Even if there is no reference to it anywhere there are still ways to get hold of it, for example by calling processes/0 or list_to_pid/1 (very naughty). Also in a distributed node then other nodes may contain references to a process even if there are no local references.
There are some things in Erlang which are not collected, for example pids, ets tables and modules.
----- "Tony Hannan" <tonyhannan2@REDACTED> wrote:
> Does an orphaned waiting process get garbage collected? By orphaned I
> no one references it (no one has its pid) so it will never receive
> messages. By waiting I mean it is waiting for a message inside a
> For example,
> Wait = fun() -> receive _ -> 0 end end.
> Will that spawned process live and wait forever even though we did
> capture its pid and thus can't send messages to it, or will it be
> collected eventually?
More information about the erlang-questions