[erlang-questions] question: "Erlang literals are no longer copied when sending messages."

Sverker Eriksson sverker.eriksson@REDACTED
Thu Oct 26 20:13:39 CEST 2017

On 10/26/2017 06:03 PM, Boshan Sun wrote:
> Does those literals lives in the constant heap has a ref counter, as 
> the refc binary? If not, how do they get garbage collected? If so, 
> will those constant suffers same "memory leak" issue has refc 
> binary?(a process touched lots of refc binary but never get garbaged 
> collected, so those refc binaries cannot be garbage collected for a 
> long time)

No, literals are not ref counted.

All literals belong to a loaded module instance. When that (old) module 
instance is purged, all process heaps are scanned and heaps containing 
those literals will do a special garbage collection where the literals 
are copied.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171026/bfd4929d/attachment.htm>

More information about the erlang-questions mailing list