News for hackers. Stuff that matters.
Re:Erlang Garbage Collector by hyperpape on Thursday November 30, 2017 @07:00PM (#15820801)
These are good questions.

Concurrent compacting collectors are pretty tough however, and a single process STW should be much faster than a global one, since it will be (at worst) proportional in time to the per process heap size.

Re:Erlang Garbage Collector by weberc2 on Thursday November 30, 2017 @07:45PM (#15821049)
I suppose it would need to be compacting; Go seems to get along okay without compaction, presumably because it has value types?
Re:Erlang Garbage Collector by aidenn0 on Friday December 01, 2017 @01:56AM (#15822416)
Go has traded throughput for latency. The throughput of a semispace copying collector is very high for most workloads, but can suffer latency issues. There is literally zero cost to collecting garbage in the nursery with the algorithm described in TFA (a nursery collection has a cost proportional only to the live data), and the cost of allocating in the nursery is just incrementing a single value. However eventually you need to collect the entire heap, and it's still proportional to the size of the live data, which is usually the majority of the heap (since you've already collected the nursery at that point).
Re:Erlang Garbage Collector by weberc2 on Friday December 01, 2017 @10:27AM (#15824332)
Sorry, I'm confused. Is Go's GC the semispaced copying collector or the TFA? Or neither? Or both?
Re:Erlang Garbage Collector by aidenn0 on Friday December 01, 2017 @02:57PM (#15826814)
TFA == "The Fine Article" so refers specifically to the Erlang Garbage Collector.

"Semispace" is one term to refer to the family of garbage collectors that Erlang's derives from. The heap is divided into two spaces, hence "semispace"

So Go's GC is neither. Go's gc is tuned for lower latencies, and that tends to rule out moving collectors (there are ways of having incremental moving collectors, but they complicate the runtime a bit).

Re:Erlang Garbage Collector by weberc2 on Friday December 01, 2017 @09:50PM (#15829825)
Ah, thanks for the information and clarification!
Re:Erlang Garbage Collector by tychver on Thursday November 30, 2017 @09:07PM (#15821389)
Go trades the complexity of a compacting GC for forcing you to restart the app regularly if you have a workload with plenty of heap allocation.
Re:Erlang Garbage Collector by weberc2 on Thursday November 30, 2017 @11:45PM (#15821980)
Really? I've never heard anyone mention this and I've followed Go for years.
Re:Erlang Garbage Collector by tychver on Friday December 01, 2017 @08:36AM (#15823683)
Yeah, it mostly happens when you have a server which runs an abnormally large task or payload, causes the heap to grow, and does it in a way that Go can't release the memory back to the OS due to heap fragmentation.

I haven't looked at this for a while but I believe it's still an issue.

https://github.com/cockroachdb/cockroach/issues/2007 https://github.com/golang/go/issues/18896 https://github.com/golang/go/issues/14045