Repository navigation
Add garbage collector aware recycler - #647
Conversation
b0d7c6d to
09769e2
Compare
|
Thanks for the PR. One callout, this may result in a small bloat in how much extra heap a delta transition allocates- currently a delta transition can reuse a long[] from the memory pool that is already being referenced by reader threads and thats ok because those reads get invalidated later Also thinking from a rollout perspective maybe good to gate this behind a feature flag. Other than that, just noting that the status quo seems appealing from the standpoint that java GC has a smaller region to manage so maybe able to work more efficiently, making impact to read performance a little less likely. But I do see the efficiency argument with the patch that when data size shrinks hollow wont hold on to more heap than necessary. Would be good to get @dkoszewnik 's buy in. |
Neither will be a concern with the low pause collectors. I bet G1 was the reason this optimisation was required, because evacuation failures are so expensive. The heuristics that determine the young/old balance would have had a hard time accomodating the infrequent allocation spikes caused by delta updates. It no longer matters, and in fact, promotion failures are something than Generational Shenandoah expects, IIRC it can fall back to promoting a region in place, instead of copying. These collectors have essentially constant pause times, in the case of ZGC well below 1ms, that don't scale with heap size or allocation rates. Any impact to application latency is in things like store/load barriers, and the impact of the collector running concurrently with the application, but you've already made that trade off by your selection of GC. |
|
The use of the recycler predates G1, the rationale dates back to the CMS collector. If this complexity is no longer necessary, I'm all for simplifying. A side note -- before G1 was GA (and slightly after, IIRC), we tested with candidate versions and occasionally ran into |
Testing against this patch indicates that the pooling of byte arrays when using the modern, low-pause collectors is unnecessary, because there are no pauses for evacuation failures to cause an impact to application latency.
For a 2,500 second runtime, the baseline generational ZGC cluster:
Versus generational ZGC w/ patch:
Example of overhead: