[erlang-bugs] Simple floating-point lists operation hungs Erlang system

Björn-Egil Dahlberg wallentin.dahlberg@REDACTED
Sat Nov 26 22:28:57 CET 2011


2011/11/26 Denis Nesterov <copypastor@REDACTED>
>
> Another question - how can I estimate size of data structures, and know
> more about internal erlang data structures?
>

A useful function can be erts_debug:flat_size/1. Take any erlang structure
into this function and it will return the word size for that structure.


>
> For example, here:
> http://www.erlang.org/doc/efficiency_guide/advanced.html stated that
> 'float' takes 16 or even 24 bytes on 32/64 bit system respectively. Is that
> true? I just can't figure out for what reason float number (double, or even
> extended precision) can take whole lot of space...
>

Any data in erlang takes a minimum of one word of data, i.e. 4 or 8 bytes
as you said. I think for float there is a header, 1 word and the float_def
(see erl_term.h). And yes it takes a bit more memory than is *really*
needed for defining a float but it is needed for defining it within the
virtual machine. The header is for instance needed for identifying the data
and all data needs to word sized aligned.

// Björn-Egil


>
> 2011/11/26 Björn-Egil Dahlberg <wallentin.dahlberg@REDACTED>
>
>>
>>
>> 2011/11/26 Erik Søe Sørensen <ess@REDACTED>
>>>
>>> Still, I think there's a point in that the situation would be less
>>> mysterious if the error message about what caused the crash-dump was
>>> printed (and flushed) before the crash-dump is written out.
>>>
>>
>> I agree! =)
>>
>> // Björn-Egil
>>
>>> ________________________________________
>>> From: erlang-bugs-bounces@REDACTED [erlang-bugs-bounces@REDACTED]
>>> On Behalf Of Erik Søe Sørensen [ess@REDACTED]
>>> Sent: 26 November 2011 03:13
>>> To: Denis Nesterov; erlang-bugs@REDACTED
>>> Subject: Re: [erlang-bugs] Simple floating-point lists operation hungs
>>> Erlang system
>>>
>>> I can reproduce this on Linux (Intel(R) Core(TM)2 Duo CPU, 2.10GHz, 2GB).
>>> This was done using 4 processes and 750k elements; apparent deadlock
>>> happened within a couple of minutes (but see below).
>>>
>>> The OS threads of the Erlang VM are stuck doing this:
>>> [snip]
>>> _______________________________________________
>>> erlang-bugs mailing list
>>> erlang-bugs@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-bugs
>>>
>>
>>
>> _______________________________________________
>> erlang-bugs mailing list
>> erlang-bugs@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-bugs
>>
>>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20111126/c5dd43c6/attachment.htm>


More information about the erlang-bugs mailing list