Question about Shenandoah pacer
Aleksey Shipilev
shade at redhat.com
Thu Jan 14 11:46:34 UTC 2021
On 1/13/21 11:07 PM, Kemper, William wrote:
> I'm considering a change that would have the heap notify the pacer directly of allocations.
> Currently, the heap notifies ShenandoahControlThread of words allocated, where they are
> accumulated into an _alloc_seen member. On iterations of the control thread loop that do not
> perform a GC, the accumulated _allocs_seen are passed to the pacer (otherwise, they are dropped
> and reset at the start of the next loop). Would there be harm in having the heap send these
> alloc'd words directly to the pacer?
>
> I'm also a little confused because these 'allocs_seen' are added to the pacer's budget - I
> thought allocations consumed the budget?
What you see involves ShControlThread for a reason: it checks that ShControlThread is able to catch
up with allocations outside of the cycle. In other words, ShControlThread replenishes the budget
with the allocations it had seen and decided not to act. If you record allocations straight to
pacer, you deconstruct this feedback loop.
This whole thing matters because heap can run out of free space before control thread would be able
to act.
--
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list