[erlang-questions] Read-only binary: does it stay in the same memory location?

Dmytro Lytovchenko dmytro.lytovchenko@REDACTED
Fri Dec 22 00:12:57 CET 2017

No, the binary will not be moved unless there is some scan algorithm
implemented in GC to visit all process heaps, all registers and all stacks
and possibly all ETS tables and update all pointers to a moved binary.
Which i really doubt it is happening. So no, it will never be moved until
garbage collected.

2017-12-22 0:10 GMT+01:00 Frank Muller <frank.muller.erl@REDACTED>:

> Hi guys
> Suppose I’ve a big binary (35MB) in the state of my gen_server process X.
> This binary is never shared with any other process, it’s never updated,
> and stays there for lifetime of process X.
> Question: internally, may the VM moves this binary around to different
> memory locations if needed? Or not because this binary is never
> shared/updated ?
> /Frank
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171222/e4d97947/attachment.htm>

More information about the erlang-questions mailing list