Improving G1 out-of-the-box performance
kstefanj.github.io
kstefanj.github.io
* We've optimised this release for throughput
* We've optimised this release for latency
* We've optimised this release for minimising memory usage
...and each release causes a regression in the stuff they weren't optimising for, leading to another future release picking one of the other three targets.
Java and Go seem to have gone round this cycle more than once...
Whereas for Go memory usage is more or less same in almost every release. They have singular focus on latency improvement in general or very specific type of workloads with each new release.
Also, the cost of memory keeps dropping, especially with auto scaling cloud services, which makes optimizing for memory footprint an increasingly bad idea.
I don't think there is a black/white world like Hotspot people tend to claim about these things. You can have your cake and eat it - acceptable latency <10ms/1ms AND good throughput/memory usage is possible without excessive manual tuning. golang is an example of this, as are GCs in other language runtimes. In every other managed language I've worked in, I never even think about the GC 99% of the time. Whereas with Hotspot you have to tune and think about it 100% of the time. Hopefully it will get there one day and make working on JVM projects less painful.
“It isn't that the generational hypothesis isn't true for Go, it's just that the young objects live and die young on the stack. The result is that generational collection is much less effective than you might find in other managed runtime languages” https://twitter.com/davecheney/status/1019430967054819328
Go's GC improvements are revealed in P99.9 latencies of servers over time, not just in the raw numbers of how long it's stopping the world.
This means the same problem as before can be observed, you'll just need slightly bigger objects to get there.
Working in low-latency space the angle for me is much more about GC latency (in microsecond-level scales). I've never seen anyone doing a thorough evaluation of GC times across different implementations.
Does anyone here have any interesting sources to share?
Also, what are the parameters for this assessment (cpu count, cpu frequency, memory frequency, heap size, object demography etc)?
https://wiki.openjdk.java.net/display/zgc/
I think the plan is to reach the 1ms worst-case goal in 15 or 16.
I might do some performance tests of my own soon.