[erlang-questions] Help with storing data in memory

Bob Ippolito bob@REDACTED
Thu Mar 25 23:49:46 CET 2010


On Thursday, March 25, 2010, Max Lapshin <max.lapshin@REDACTED> wrote:
> On Fri, Mar 26, 2010 at 1:10 AM, Bob Ippolito <bob@REDACTED> wrote:
>> You might need to tune the frequency of garbage collection or make
>> manual calls to erlang:garbage_collect(). You should also make sure
>> you are using the latest Erlang VM, the garbage collection strategy
>> for binaries has been significantly improved in recent versions.
>>
>
> R13B4. There is one question:
>
> f({a, b, A}) ->
>   g({e,f, A}).
>
> Will the A element be copied twice or compiler is smart enought to
> keep it untouched?
> I.e. when I set element number 405450 in array, is the whole array
> recreated or maybe just small part of it?
>

There is no copying of A, but there is a new tuple created {e, f, A} of course.

-bob


More information about the erlang-questions mailing list