Re:Multicore OCaml: Feb 2020 update
by jeremyjh on Friday February 28, 2020 @05:43PM
(#22447102)
Erlang doesn't really have concurrent gc, instead it uses shared nothing heaps and copies values everytime a process sends a message to another process.
[ Parent
| on HN ]
and all of those copies have to be garbage collected, concurrently to the operations being run. Memory isn't infinite on long-lived servers.
No, there is no concurrent garbage collection happening. When a process is running user code, it is not being garbage collected and vice versa. It happens at an individual process level, but the process is definitely paused while its heap is collected. It has similar benefits to concurrent garbage collection such as the fact that there is never a stop-the-world-pause, and short pauses (since the heaps are typically very small), but it is not the same and means different trade-offs and tuning may be required at the extremes.
> When a process is running user code, it is not being garbage collected and vice versa
That doesn't make it 'not a garbage collector' and it also doesn't make it 'not concurrent'.
> tuning may be required at the extremes
that is very rare, and if that is disqualifying for a concurrent GC, then Java is disqualified as a concurrent GC.
It is not "qualified" because the process using a heap is paused while the heap is collected. In a concurrent GC, nothing is paused.
that's a silly distinction, because if you are running multiple threads on a single CPU, or even multiple threads on multiple CPUs, in most situations, then you're simply pushing the 'pausing' down to the hardware/os which is doing the preemption.
Thread preemption has nothing to do with garbage collection pauses. An Erlang process that allocates a lot will spend more time being paused, irrespective of its priority which might otherwise let it run uninterrupted. I'm not going to continue this "argument" further.