Re:Modern garbage collection
by micmus on Tuesday December 20, 2016 @09:20AM
(#13219966)
Erlang has a per-process GC - each Erlang process has it's own heap and it's own garbage collector. There's no VM-wide GC. This usually means the GC pauses apply only to a small part of your system, while the other parts are running completely normally. There's a good article that describes it in depth: https://www.erlang-solutions.com/blog/erlang-19-0-garbage-co...
[ Parent
| on HN ]
Also if you have a lot of data you use an ets table which is more or less an in-process but off-gc-heap key-value database.
Re:Modern garbage collection
by staticassertion on Tuesday December 20, 2016 @12:08PM
(#13221686)
Thanks, I've been wondering how Erlang does GC.
Re:Modern garbage collection
by AstralStorm on Tuesday December 20, 2016 @12:24PM
(#13221829)
Of course, the cost is extra heap fragmentation.
In Erlang case, that is not so much of a problem as most allocated objects have essentially same size. On the other hand this causes another problem that GC's and allocators in Erlang VMs tend to have enormous overhead because most most GC'd objects are very small with sizes comparable to per-object GC overhead.