[erlang-questions] Reference counting instead of GC?

Alpár Jüttner <>
Thu Jul 3 23:49:46 CEST 2008


On Thu, 2008-07-03 at 07:41 -0700, Thomas Lindgren wrote:

> 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".)

Could you tell me where can I find some info about these modes? The erl
manual doesn't even list the -shared and the -hybrid switches.

> 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.

Yes but at least it is a deterministic and predictable time you can
calculate with.

>  (But you may be thinking of more sophisticated variants than that.)

Yes indeed, the process of dropping the unused terms can be safely
interrupted.

In fact, my idea was to have a special (low priority) process in the
emulator taking care of the unused terms. In this way the dropping of
big data could be automatically postponed if there are "more urgent"
things to do.

Best regards,
Alpar




More information about the erlang-questions mailing list