Erlang/OTP: Garbage Collector
21–30 of 79 posts
Re: Erlang/OTP: Garbage Collector
#22Earlier quoted context omitted.
Why not? JVM has a highly optimized concurrent GC.
It’s a GC tuned for imperative languages that prefer mutation over allocation, which is the exact inverse of what BEAM needs.
Re: Erlang/OTP: Garbage Collector
#23Earlier quoted context omitted.
Wouldn't Erlang be much more efficient if it simply compiled to the JVM?
Almost 10 years ago, i've tested erjang [1] using a medium sized application. Throughput was better than BEAM but latency was terrible. [1] https://github.com/trifork/erjang/
Re: Erlang/OTP: Garbage Collector
#24Re: Erlang/OTP: Garbage Collector
#25Earlier quoted context omitted.
Wouldn't Erlang be much more efficient if it simply compiled to the JVM?
Almost 10 years ago, i've tested erjang [1] using a medium sized application. Throughput was better than BEAM but latency was terrible. [1] https://github.com/trifork/erjang/
Re: Erlang/OTP: Garbage Collector
#26The post glosses over the most important part of Erlang's GC: it collects process heaps separately. This transforms a hard problem (collecting a global heap with low latency despite concurrent mutators) to a _much_ simpler problem, at the price of more copying. Compare Java's G1 with Erlang's GC; the former hurts my head. For those problems that are amenable to Erlang's model, this is a fine solution. The only real i…
Erlang also has reference counters for things like strings that are immutable and can be shared between threads (processes in Erlang). Overall this is a good model. Use GC for small per green thread heaps. Then use reference counters for shared immutable structures that cannot form cycles and copy everything else.
Re: Erlang/OTP: Garbage Collector
#27Earlier quoted context omitted.
Almost 10 years ago, i've tested erjang [1] using a medium sized application. Throughput was better than BEAM but latency was terrible. [1] https://github.com/trifork/erjang/
Ten years ago was two whole technological generations ago in the implementation of OpenJDK's GCs. OpenJDK now has a maximum pause time of under 1ms for heaps up to 16TB.
Re: Erlang/OTP: Garbage Collector
#28ORCA (as part of the Pony compiled language) includes a more performant GC than C4 or BEAM/HiPE. It does so by reducing almost to zero the need to do global GC pauses by sharding the heap per actor, zero-copy message passing, fine-grained concurrent sharing semantics, and lock-free data structures.
Re: Erlang/OTP: Garbage Collector
#29The post glosses over the most important part of Erlang's GC: it collects process heaps separately. This transforms a hard problem (collecting a global heap with low latency despite concurrent mutators) to a _much_ simpler problem, at the price of more copying. Compare Java's G1 with Erlang's GC; the former hurts my head. For those problems that are amenable to Erlang's model, this is a fine solution. The only real i…
Wouldn't Erlang be much more efficient if it simply compiled to the JVM?
Re: Erlang/OTP: Garbage Collector
#30ORCA (as part of the Pony compiled language) includes a more performant GC than C4 or BEAM/HiPE. It does so by reducing almost to zero the need to do global GC pauses by sharding the heap per actor, zero-copy message passing, fine-grained concurrent sharing semantics, and lock-free data structures.
I mean, the BEAM doesn't have global GC pauses either, as each process has its own heap - but I would expect Pony can take things a step further as a result of its strong type system, which IIRC is why it can support zero-copy messaging.
If one can avoid GCs altogether a-la precise (de)allocations like Rust's non-reference-counted entities, this is cool but often requires unnatural contortionism. RC is still necessary in certain cases.