[erlang-questions] Actor garbage collection

Tony Hannan tonyhannan2@REDACTED
Thu Nov 4 15:46:43 CET 2010


Thanks guys. It would be nice, although I know its hard in a distributed
setting, but there is research on it. See
http://scholar.google.com/scholar?q=distributed+actor+garbage+collection

Cheers,
Tony

On Thu, Nov 4, 2010 at 10:19 AM, Robert Virding <
robert.virding@REDACTED> wrote:

> Hi,
>
> 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.
>
> Robert
>
> ----- "Tony Hannan" <tonyhannan2@REDACTED> wrote:
>
> > Hello,
> >
> > Does an orphaned waiting process get garbage collected? By orphaned I
> > mean
> > no one references it (no one has its pid) so it will never receive
> > anymore
> > messages. By waiting I mean it is waiting for a message inside a
> > receive.
> > For example,
> >
> >     Wait = fun() -> receive _ -> 0 end end.
> >     spawn(Wait).
> >
> > Will that spawned process live and wait forever even though we did
> > not
> > capture its pid and thus can't send messages to it, or will it be
> > garbage
> > collected eventually?
> >
> > Thanks,
> > Tony
>


More information about the erlang-questions mailing list