[erlang-questions] refactoring a very large record

Matthew Sackman matthew@REDACTED
Thu Oct 20 18:38:51 CEST 2011


On Thu, Oct 20, 2011 at 08:35:38PM +0400, Michael Uvarov wrote:
> How does VM know when terms in the tuple are ready to be garbage
> collected? Is there counter of live painters?

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.

Matthew



More information about the erlang-questions mailing list