[erlang-questions] refactoring a very large record

Björn-Egil Dahlberg <>
Thu Oct 20 22:12:45 CEST 2011


It is.

But rather then "mark-and-sweep" that is hinted at here, erlang runtime
system uses a copying collector.
Without going in to gritty details, anything that can be reached from a
rootset (stack, registers and a few other things) are live data and copied
to a new heap. The old heap is then deallocated.

// Björn-Egil

2011/10/20 Jesper Louis Andersen <>

> On Thu, Oct 20, 2011 at 18:38, Matthew Sackman <>
> wrote:
> >
> > I don't know how Erlang does it, but one approach is that from all your
> > processes stacks, traverse all pointers and mark all found terms as
> > "visited" (transitively). Then, work through everything in the heap and
> > anything not marked "visited" can be reclaimed.
> >
> > With erlang's heap-per-process memory model and plus generational GC, I
> > could imagine this would work fairly well, but I've no idea whether this
> > is actually what's used.
> >
>
> This is what is used, to my knowledge.
>
> --
> J.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111020/6e1e6edf/attachment.html>


More information about the erlang-questions mailing list