[erlang-questions] Reference counting instead of GC?
Thu Jul 3 16:41:35 CEST 2008
--- On Thu, 7/3/08, Alpár Jüttner <alpar@REDACTED> wrote:
> Did anyone consider replacing the garbage collection with
> counting in the Erlang emulator? How difficult would it be
> to do?
Good luck :-) However, note that the hipe guys have over the years proposed garbage collectors with most of the good properties you mention. (Cf the "shared" and "hybrid" emulators. E.g., "erl -hybrid".)
Also note that simple reference counting does not guarantee real time collection or bounded or even short pauses. Consider the case when you drop a big term: a reference counting implementation must decrement the reference counts of all subterms (recursively), while a copying collector won't even visit the dead data. Because the dead term can have arbitrary size, the pause while it is traversed is not bounded. (But you may be thinking of more sophisticated variants than that.)
More information about the erlang-questions