Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by the8472 on Friday September 17, 2021 @06:37AM
(#28563629)
Go isn't playing in the same league though since their GC is non-generational and non-compacting. A lot of the difficulties implementing concurrent GCs comes from moving things between generations and compacting.
[ Parent
| on HN ]
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by DougBTX on Friday September 17, 2021 @06:45AM
(#28563712)
I had this benchmark[0] in mind while writing the comment, though perhaps Go does well there by avoiding GC rather than having fast GC as-such? That would explain why its performance is close to the non-GC languages.
[0] https://awesomeopensource.com/project/ixy-languages/ixy-lang...
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by throwaway894345 on Friday September 17, 2021 @09:31AM
(#28565263)
Without digging into that benchmark, Go leans on stack allocation a lot more than many GC languages, and that’s a big part of why Go is able to achieve otherwise impressive performance. The same mechanism (idiomatic value types) that allows Go to elide GC in many cases also permits better cache coherency—there are fewer pointers into random regions of the heap so cache lines need to be flushed less frequently.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by stingraycharles on Friday September 17, 2021 @06:59AM
(#28563832)
Is that a good or bad thing? What’s the trade-off being made here?
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by throwaway894345 on Friday September 17, 2021 @09:29AM
(#28565234)
Compacting GC tends to have cheaper allocs and longer pauses (allocs need to be moved to different regions of memory and pointers to those allocs need to be rewritten to point to the new memory regions) while noncompacting has the opposite: slow allocations and small pause times.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by kaba0 on Friday September 17, 2021 @07:42PM
(#28572117)
Though many part of compaction can be moved to a parallel thread, can’t it? The actual stop-the-world time can be quite small that way (using read-barriers though)
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by throwaway894345 on Friday September 17, 2021 @08:27PM
(#28572397)
I’m not so sure about barriers, but compacting requires rewriting pointers that are shared with the mutator threads, so it seems hard to parallelize.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by kaba0 on Saturday September 18, 2021 @12:13PM
(#28577283)
As far as I know, this is the “secret” of ZGC at least, it replaces the usual write barriers with read ones. So a parallel thread is free to move an object to a new place, and any thread trying to access it will at that point lock said object. This will have a performance impact (the usual write barriers have better throughput because they only “lock” when writing an object), but more of the GC can be parallelized.
But I’m by no means anywhere close to an expert in the topic.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by throwaway894345 on Saturday September 18, 2021 @01:09PM
(#28577695)
Interesting. What about an application thread (“mutator” in GC parlance) that tries to write to the pointer? Does that hit the read barrier as well? Does this imply worse application throughout to improve GC metrics? If so, I wonder how much worse? (Not asking you per se, but wondering aloud)
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by 5e92cb50239222b on Friday September 17, 2021 @07:09AM
(#28563906)
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by vips7L on Friday September 17, 2021 @03:27PM
(#28569922)
That article is beyond out of date when it comes to Java GC.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by Thaxll on Friday September 17, 2021 @09:35AM
(#28565306)
The problem is that there is not benchmark for GC, but from my experience the Go GC is very good, aka sub 1ms.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by SureshG on Friday September 17, 2021 @07:37PM
(#28572094)
Is this the case very large go heaps? ZGC claims sub ms pause for TB heap size.
Re:Shenandoah in OpenJDK 17: Sub-millisecond GC pauses
by isbvhodnvemrwvn on Friday September 17, 2021 @07:01AM
(#28563843)
Shenandoah is also not generational, at least the implementation I looked at a year ago wasn't.