[erlang-questions] Frequency of module reloading and the constant pool

Edmond Begumisa <>
Thu Sep 21 00:23:01 CEST 2017

Thanks Lukas, 

That is very very helpful information as it not only gives me knowledge of what to benchmark, it also gives me  some surprising insights on how to reorganise my (now obviously naive) code.

Apart from GC, is there anything else I should be concerned about like costly locks and memory barriers? For instance, is a fat mutex held for all schedulers when scanning all the process heaps?

- Edmond -
On Tuesday, 19 September 2017 at 19:40 Lukas Larsson <> wrote:

On Tue, Sep 19, 2017 at 11:13 AM, Adam Lindberg <> wrote:

Cost wise I'm not sure, but I would advice you to benchmark for your use case.

Every time you purge a module, each process heap is scanned for any sign of the old literals (aka constants) and if a literal is found a GC is done of that process which copies the literal onto its heap.

So the cost depends on the total heap size of all running processes and the number of processes that have a reference to those literals on their heaps at the moment of the purge.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170920/0edf8546/attachment.html>

More information about the erlang-questions mailing list