multiple heaps

Raimo Niskanen raimo@REDACTED
Mon Oct 16 18:21:52 CEST 2000


The separate heaps improve the soft real time characteristics of the
emulator - the garbage collector works on the process heaps. One large
heap would lead to longer idle times for garbage collection, unless the
large garbage collector would be very incremental and intricate.

There has been a few experiments with common heap and garbage
collection, but the results were disappointing. It seems that with
modern microprocessors the cost to copy data between heaps is cheap, if
the memory pages happens to be in the processor cache, and with a large
common heap the probability of a chache miss increases and eats up the
gain of not having to copy.

And frankly, the structures copied between heaps are not that large and
complex on the average. For bulk data transfer You should pass binary
objects instead, which are allocated in common storage off heap (if not
smaller than 64 bytes (for the current BEAM emulator)).

/ Raimo Niskanen, Erlang/OTP


Miguel Barreiro Paz wrote:
> 
>         Is there any reason why each process keeps its own separate heap
> instead of one global heap? Doesn't the cost of sending large complex
> structures as messages among processes in the same node justify it? - ie.,
> instead of just copying pointers to the process mailbox.
> 
> Regards,
> 
> Miguel



More information about the erlang-questions mailing list