Hacker News new | ask | show | jobs
by the-smug-one 1001 days ago
>> (concurrent mark/sweep, parallel old, etc)

Both of those are only picked for low sized heaps with few cores, probably within a container. Were these micro services?

G1 is the default for larger heaps and multiple cores, and ZGC and Shenandoah (low latency GCs) have to be manually turned on AFAIK.

OP said:

>Java doesn’t slow down the allocation rate, it tries to keep up with the churn.

This is incorrect. ZGC will block a thread when it cannot give a thread any memory, because it can't collect and free memory at the pace needed. Google "allocation stall" for this. ZGC can achieve very low latencies akin to Go's GC, I don't know if the throughput is higher or not. Multiple cores and some GiB of heap space is when ZGC will shine.