News for hackers. Stuff that matters.
Re:Why I love Go by openasocket on Tuesday December 05, 2017 @06:48PM (#15857295)
Hotspot has several GC algorithms available, FYI. And the term "stop the world" is misleading, it doesn't fully capture the nuance of garbage collection. Any GC algorithm that does compaction will require some sort of blocking. You can do compaction incrementally, so you only lock small sections of the heap at a time, but that would still be considered "stop the world" despite being orders of magnitude faster than the naive case.

Go GC gets to make the claim that it doesn't "stop the world" because it doesn't do heap compaction. Which will become a major problem when dealing with large in-memory data structures or certain usage patterns.

And the fact that they still don't have a generational collector is concerning.

Re:Why I love Go by tychver on Wednesday December 06, 2017 @09:22AM (#15861192)
Erlang has a really nice solution here by using a separate heap per Erland "process", and because they're owned by that process, can do a copying/compacting GC without having to take any kind of locking. Ruby's Guilds could adopt a similar idea and avoid STW GC there too.
Re:Why I love Go by openasocket on Wednesday December 06, 2017 @12:02PM (#15862682)
Again, the term "stop the world" is misleading, there are a variety of compaction strategies that greatly minimize locking. There are even realtime GC implementations for the JVM.

Erlang's solution is interesting, but remember in Erlang processes can't share memory, they only have message passing. So you never have to worry about multiple threads writing to the same data structure at once, which is what makes compaction hard.

Re:Why I love Go by tychver on Wednesday December 06, 2017 @05:30PM (#15865675)
Sure they can. There’s a separate shared heap which uses atomic ref counting.