Garbage collection

Klacke klacke@REDACTED
Fri Aug 27 10:49:13 CEST 1999



 > 
 > The question is whether the Boehm-Weiser could collector be used. It is a good
 > one, tested and free. On the right platforms, it offers incremental collection,
 > thus reducing the danger of a big process freezing the others while collecting.
 > 
 > 
 > There must be a reason for not using it, I don't imagine no one else thought
 > about that.
 > 


Well we have discussed using that sort of conservative collector
as well. We only talked about it a couple of years ago but as far as
I know nobody ever did any experiments with the Boehm collector.

It does however require a pretty extensive rewrite of the runtime
since it's a malloc/free plugin replacement. I also think that it would
be pretty slow for erlang since the absolute majority of allocations
in erlang is the allocation of a cons cell.

Allocating a cons is done as:

uint32 *mem = p->htop;
p->htop += 2;

This is fast, if the Boehm collector should be used, we
need to replace this with:

uint32 *mem = (uint32*) malloc(2);

which is slow, extremely slow.

However I'm not discarding the idea entirely, maybe the 
Boehm colect together with some hacks to do fast allocate
cons cells is good. I really don't know and it would take
a couple of months of hard work to find out.


/klacke







More information about the erlang-questions mailing list