Garbage collection

James Hague jhague@REDACTED
Thu Sep 2 18:25:35 CEST 1999


On Thu, 2 Sep 1999, David Brown wrote:
> 
> Their collector is single threaded, and single heaped.  Moving to this
> model might help with efficiency, since we could avoid the copy when
> sending local messages.  The collector just needs to be run
> periodically (easy with an interpreter) and only needs to be informed
> about mutations.  It also eliminates issues with allocation in a
> process whose GC would be running.

A nice benefit of a separate heap per process is that you can just throw
out all the data for that process when it's killed.  Sharing a single heap
would potentially result in more frequent collections.

It would be handy for passing large messages around, though.  I often find
myself writing a database server that other processes query with messages
like "send me a list of all items that meet criteria X."  In the case of
having numerous processes making queries very frequently--i.e. thirty or
more times a second--it would be nice to avoid the copy.

But the point of Erlang is to not think about low-level efficiency unless
you really need to, eh? :)

James




More information about the erlang-questions mailing list