[erlang-questions] immutable benefits

Henning Diedrich hd2010@REDACTED
Thu May 13 02:10:03 CEST 2010


That's addressed on pg 172. I am not sure if it is the whole answer, 
since "shrinking" is used in a different context here:

"If a process simply keeps binaries (either in "loop data" or in the 
process dictionary), the garbage collector may
eventually shrink the binaries. If only one such binary is kept, it will 
not be shrunk."

Shrinking, in the rest of the paragraph only addresses the deletion of 
'reserve space' that is allocated in advance to allow for faster appending.


Raoul Duke wrote:
> On Wed, May 12, 2010 at 4:37 PM, Henning Diedrich <hd2010@REDACTED> wrote:
>   
>> So with the benefits being in fact as big as I had hoped for, I am wondering
>> if I am getting this right: binary scans do indeed cascade down several
>> levels and may all end up pointing to the same source chunk of memory?
>>     
>
> as an aside, i wonder if one must be careful like with Java Strings:
> keeping a reference to a small portion of the whole thing prevents the
> whole thing from being garbage collected.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>
>   


More information about the erlang-questions mailing list