[erlang-questions] memory allocation and constant pool behavior

James Hague <>
Mon May 23 19:00:28 CEST 2011


> So the heap overhead for a tuple is 1 word, but there is a handle
> to the tuple somewhere too.

Thank you for the clarification!

To me, it's simpler to say that a tuple has one word of overhead plus
one word for each element. An element is either right there (in the
case of small integers and atoms) or it's a pointer elsewhere.

Getting back to the original posters question, the answer is that the
function allocates 3 words: 1 for the tuple overhead, 2 for the
elements.



More information about the erlang-questions mailing list