Binaries

Vlad Balin <>
Tue May 11 17:28:07 CEST 2004


Excellent.

It looks like it's quite easy to implement copy elimination for large
(ref-counted) binaries, if we allow modifications of binaries.
Has anyone thought about it? Is it planned to do?

-----Original Message-----
From: Erik Stenman [mailto:]
Sent: Tuesday, May 11, 2004 6:47 PM
To: 
Subject: RE: Binaries



Vlad Balin wrote:
> Could tell me please, which GC technique is used for
> binaries? Is it differs from one for other types, such as
> tuples and lists, or the same "stop-and-copy" algorithm?

Large binaries are reference counted and shared among
all processes on one Erlang node. They are not copied,
neither by GC nor by message passing.
(The reference count causes a small overhead to the normal
 GC to keep track of when a reference to a binary dies.)

Smaller binaries are kept on the process heap and
are GC:ed by the same mechanism as other Erlang terms.

I think that in the current system a binary is considered
small if it is smaller than 64 words, but this is a vague
memory only, you'd better look in the source to be sure.

Erik
--------------------------------------
I'm Happi, you should be happy.
Praeterea censeo 0xCA scribere Erlang posse.




More information about the erlang-questions mailing list