multiple heaps

matthias <>
Mon Oct 16 23:37:55 CEST 2000



 > > The separate heaps improve the soft real time characteristics of the
 > > emulator 

Miguel Barreiro Paz writes:

 > 	Now, wouldn't a shared heap with more generations achieve the same
 > effect? - quoting Erik Johansson:

A common style of programming in Erlang involves starting many
(relatively) short-lived processes which do some work which involves
expanding the heap, wait for a timer to expire and then die.

When that process dies, the runtime system can throw away that
process' heap without having to sift through it and figure out what's
used and what isn't. I.e. no marking, sweeping, tracing or similar
cache-workout code.

If you have many processes which execute with essentially the same
code and data, for instance a call state machine, you can tweak the
initial heap size to completely avoid garbage collection for all such
processes. This tends to be more useful if you first make sure that
the GC really is consuming a significant proportion of CPU time or
memory bandwidth.

Matthias



More information about the erlang-questions mailing list