Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Look at ZGC GC. It has less latency due to stop-the-words than what the OS scheduler causes. (Of course at the price of throughput). But also the default GC, while on default being more throughput preferring can be tuned by a single paramater.


> Look at ZGC GC.

I did, it caused huge pauses with my application (I think probably a bug).

> But also the default GC, while on default being more throughput preferring can be tuned by a single paramater.

Sure, but how many people will do even that much tuning? Defaults are important, and IMO Java chooses a bad one; responsive by default and tuneable when you need maximum throughput is better than the reverse. (I suspect they picked the defaults they did to be competitive against C++ in benchmarks, but we're well past the time where that's what you're competing with).

Same as how Go and Electron have been very successful - not because they're great to work in per se, but because they have so much less friction between writing a hello world program and getting an executable you can distribute.


That’s not how it works. It’s not like Java’s GCs in the last decade had any sort of huge pauses unless the program did some stupid shit like allocation in a hot loop. (G1GC, the default since 9 promises by default a 10ms max pause time and it can uphold that under crazy conditions even — and even after that it will get progressively slower instead of a huge increase)

Java’s GCs are the state of the art, if they struggle with a workload then it is pretty much guaranteed that other GCs have already broken down completely at the fraction of that.

Regarding your application, did you check how many objects have you allocated? VisualVM and the like can show you precisely the statistics of your allocations.


> That’s not how it works. It’s not like Java’s GCs in the last decade had any sort of huge pauses unless the program did some stupid shit like allocation in a hot loop.

Or there's a bug. There's a reason ZGC is marked as experimental. G1GC handled the application in question fine, we reverted to that and it wasn't worth our time investigating further.


While there is a possibility of a bug, I really doubt it. G1GC is just a beast and likely has just no problem with the allocation-rate your program uses while ZGC has quite a tradeoff for really low latency.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: