[erlang-questions] string in functions and memory allocation

Hynek Vychodil <>
Thu Jan 6 11:12:50 CET 2011


Constants (literals) are allocated in constant pool since Erlang
R12B-0 so it will not be constructed in each function call.

On Thu, Jan 6, 2011 at 10:25 AM, Paolo Negri <> wrote:
> Dear list
>
> I have a newbie question regarding the following 2 (dummy) functions
>
> dummy(Proplist)
>    Value = proplist:get_value(<<"booo">>),
>    Value
> .
>
> dummy_string(Proplist)
>    Value = proplist:get_value("booo"),
>    Value
> .
>
> What I would like to know it's how calling these functions an elevate
> number of times would affect memory allocation and garbage collection,
> I'm asking because in other languages something like dummy_string
> would allocate a new string at every call that would then need to be
> garbage collected.
>
> Thanks in advance for your help.
>
> Paolo
>
> --
> Engineering
> http://www.wooga.com | phone +49-30-8962 5058  | fax +49-30-8964 9064
>
> wooga GmbH | Saarbruecker Str. 38 | 10405 Berlin | Germany
> Sitz der Gesellschaft: Berlin; HRB 117846 B
> Registergericht Berlin-Charlottenburg
> Geschaeftsfuehrung: Jens Begemann, Philipp Moeser
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>



-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill
your boss.  Be a data hero!
Try GoodData now for free: www.gooddata.com


More information about the erlang-questions mailing list