Live data from Hacker News

Z Garbage Collector: The Next Generation

inside.java

51–60 of 126 posts

Re: Z Garbage Collector: The Next Generation

#51
post #2

Crazy to me that garbage collection systems are a subject of continual evolution and discussion. You'd think it would be "solved" by now... Or is that just in Java world?

Since garbage collection based memory models are mush more complex and require a lot of software engineering it is not a surprise that we have many iterations.

Re: Z Garbage Collector: The Next Generation

#52
post #32

Earlier quoted context omitted.

> If you have a GC that doesn't pause, can handle terabyte sized heaps, has great throughput, is largely or completely self-configuring, is portable, open source, supports dozens of languages and has clean code Yeah. If.

That's basically ZGC Generational + GraalVM. So, code that's available now albeit you'd have to compile it from version control (graalvm stable releases don't support zgc yet, released zgc isn't generational yet). Give it another year or so and that'll be shipping out of the box in ordinary JVMs.

No pauses and high throughput? Do you have any links to how it does this? I'd really like to know.

Re: Z Garbage Collector: The Next Generation

#53
post #6

As a Clojure programmer, I'm so happy that I'm getting all these improvements over many years. It's fashionable to complain about Java — but I don't use Java, and yet I benefit from all the fantastic work that is being done on the JVM.

I say this all the time to people that say they want to use Node because they hate Java. There are so many languages that you can execute on the JVM. It’s almost unfortunate that it’s still called the JVM. It think the JVM needs a re-branding. Even if they just change the meaning of the J. I suppose that is what GraalVM is doing, but it’s an awful name and its purpose isn’t being conveyed well. The JDK should just switch to this VM and get rid of the name JVM.

These are just my opinions.

Re: Z Garbage Collector: The Next Generation

#54
post #53
post #6

As a Clojure programmer, I'm so happy that I'm getting all these improvements over many years. It's fashionable to complain about Java — but I don't use Java, and yet I benefit from all the fantastic work that is being done on the JVM.

I say this all the time to people that say they want to use Node because they hate Java. There are so many languages that you can execute on the JVM. It’s almost unfortunate that it’s still called the JVM. It think the JVM needs a re-branding. Even if they just change the meaning of the J. I suppose that is what GraalVM is doing, but it’s an awful name and its purpose isn’t being conveyed well. The JDK should just sw…

JVM still has some limitations. https://stackoverflow.com/a/2682962/31667 Those actually influence either the design or the performance of the higher level language.

Re: Z Garbage Collector: The Next Generation

#55
post #17
post #6

As a Clojure programmer, I'm so happy that I'm getting all these improvements over many years. It's fashionable to complain about Java — but I don't use Java, and yet I benefit from all the fantastic work that is being done on the JVM.

That is the positive attitude, it always irks me when guest language comunities bash the platform that make their language even possible in first place. Everything sucks, but then they gladly take the platform, the ecosystem of libraries, debuggers and what not from the host platform.

It depends, some languages have more to complain about than others. I’d argue F# on .net basically had to spend years treading water while Microsoft’s various teams figured out .net core/framework. The community feels like it lost a lot of inertia it used to have.

Re: Z Garbage Collector: The Next Generation

#56
post #50
post #35

Earlier quoted context omitted.

Rust also relies on a GC for the more dynamic lifetimes in Rust programs (reference counting), it just doesn't call it a GC, and while Rust's GC has a lower footprint than tracing GCs, it has worse performance and it suffers from cycle problems. I wouldn't call it "bug ridden" (perhaps "limited" is a better term), but it is slow. Some think that reference counting gives better performance predictability than a tracin…

It does give better performance predictability! Decrementing a refcount may either be a no-op or expensive but crucially the op can happen only during that particular call, nowhere else.

It does not. Maintaining the counter requires more work than tracing GCs do, and you don't know in advance when the last reference is dropped. True, you get more promptness in deallocation (not the same as predictability), which reduces the footprint but comes at the expense of compaction, the lack of which in most refcounting GCs also adds unpredictability. In contrast, in the common case, allocation with a compacting, tracing GC is a pointer bump and there's no overhead at all to copying references or other memory operations. During collection cycles, GC barriers are triggered, which add overheard to things like mutating pointers or reading pointers from objects in the heap.

There's a great paper (linked from this post https://www.cs.cornell.edu/courses/cs6120/2019fa/blog/unifie...) showing how refcounting GCs can match the performance of tracing GCs -- in fact, how they can each have the properties of the other -- but that requires sophistication in the implementation of refcounting GCs that most of them don't have. So it is true that a sophisticated refcounting GC and a sophisticated tracing GC can exhibit similar behaviour, but while OpenJDK's tracing GCs are very sophisticated (especially ZGC and G1), most refcounting GCs in the wild are quite unsophisticated. It may certainly be true that unsophisticated refcounting GCs have more desirable properties than unsophisticated tracing GCs, but in practice the choice offered is between unsophisticated refcounting GCs and very sophisticated tracing GCs. The latter beat the former on most counts except for footprint overhead.

Re: Z Garbage Collector: The Next Generation

#57
post #43
post #12

This title is a perfect adversarial example for text classification. Contains both "Z" and "generation" in it but has nothing to do with Gen Z.

And Java has nothing to do with the island called Java. Javascript is not Java either. Hm. It's fine.

If the logo didn't already made it clear which Java inspired the name, the island Java was/is also instrumental when it comes to growing coffee, so still, Java the language was a bit inspired by the island Java :)

Re: Z Garbage Collector: The Next Generation

#59

The improvement in throughput is tantalising. I'd love to see a comparison to the G1GC throughput. I wonder if it's getting close enough that ZGC might some day become a candidate to replace G1 as the default collector?

As far as I know, ZGC uses a lot memory than G1, and for as long that's the situation, it's unlikely to replace G1 as a default configuration. Another understanding I have is that ZGC is best used for large workloads, compared to G1 which is more generalized and doesn't perform as well with larger workloads.

But, I'm no JVM experts and might have understood it incorrectly. Happy to be corrected!

Re: Z Garbage Collector: The Next Generation

#60
post #52

Earlier quoted context omitted.

That's basically ZGC Generational + GraalVM. So, code that's available now albeit you'd have to compile it from version control (graalvm stable releases don't support zgc yet, released zgc isn't generational yet). Give it another year or so and that'll be shipping out of the box in ordinary JVMs.

No pauses and high throughput? Do you have any links to how it does this? I'd really like to know.

That's the subject of the video being discussed. More technical info here and in the links: https://openjdk.org/jeps/439
Post reply on HN