[erlang-questions] simple question about list memory consumption

Richard O'Keefe <>
Mon Jul 9 01:39:44 CEST 2012


On 9/07/2012, at 7:41 AM, CGS wrote:

> Hi,
> 
> About the two lists you were speaking about (I suppose you were referring to the output of lists:map/2 and lists:seq/2), the second is destroyed as soon as lists:map/2 exits.

No it isn't.  It is only reclaimed when the garbage collector runs.

> On a 64-bits machine, 2 words = 16 B and 3 words = 24 B, so, my value of 21 B is exactly in between 2 and 3 words. I suppose you worked on 32-bits machine or with half-world emulator and you got half of that value (or a bit less if we are to consider that the shell is adding bigger overhead).

No, I used process_info, which reports the size in words, not bytes.






More information about the erlang-questions mailing list