[erlang-questions] Actor garbage collection

Ahmed Omar <>
Thu Nov 4 15:13:15 CET 2010


This process will be waiting forever, until it gets a message (or get an
exit signal). It doesn't matter if "we" have the pid or not. It's still a
living process. (btw, all living pids still can be listed using
erlang:processes/0)
A process will terminate when it has no more code to execute or when a
run-time error occurs.
http://www.erlang.org/doc/reference_manual/processes.html#id78133

Garbage collection has to do with the memory used by the process, not with
the process life.

On Thu, Nov 4, 2010 at 2:52 PM, Gleb Peregud <> wrote:

> No, AFAIK
>
> On Thu, Nov 4, 2010 at 14:32, Tony Hannan <> 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
> >
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>


More information about the erlang-questions mailing list