Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the accounting for gen 1 allocations by taking into account what … #60248

Merged
merged 3 commits into from
Mar 10, 2022

Conversation

PeterSolMS
Copy link
Contributor

…has been already consumed in this GC.

Details:

In gen 1 GCs, we recompute the budget at the end of the GC. However, the amount consumed in the current GC is nowhere taken into account. That causes us to do at most alternate gen 0 and gen 1 GCs, we cannot do back-to-back gen 1 GCs.

If we take the gen 1 budget as the amount of memory we are aiming to be used for gen 1, then it seems illogical to just drop the amount used in this GC on the floor.

The fix is to actually subtract the amount of gen 1 budget used in this GC from dd_new_allocation for gen 1. This is a bit awkward for server GC, because we even out the budget and the amount to subtract from dd_new_allocation across heaps after having computed it for each heap individually.

…has been already consumed in this GC.

Details:

In gen 1 GCs, we recompute the budget at the end of the GC. However, the amount consumed in the current GC is nowhere taken into account. That causes us to do at most alternate gen 0 and gen 1 GCs, we cannot do back-to-back gen 1 GCs.

If we take the gen 1 budget as the amount of memory we are aiming to be used for gen 1, then it seems illogical to just drop the amount used in this GC on the floor.

The fix is to actually subtract the amount of gen 1 budget used in this GC from dd_new_allocation for gen 1. This is a bit awkward for server GC, because we even out the budget and the amount to subtract from dd_new_allocation across heaps after having computed it for each heap individually.
@ghost
Copy link

ghost commented Oct 11, 2021

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

…has been already consumed in this GC.

Details:

In gen 1 GCs, we recompute the budget at the end of the GC. However, the amount consumed in the current GC is nowhere taken into account. That causes us to do at most alternate gen 0 and gen 1 GCs, we cannot do back-to-back gen 1 GCs.

If we take the gen 1 budget as the amount of memory we are aiming to be used for gen 1, then it seems illogical to just drop the amount used in this GC on the floor.

The fix is to actually subtract the amount of gen 1 budget used in this GC from dd_new_allocation for gen 1. This is a bit awkward for server GC, because we even out the budget and the amount to subtract from dd_new_allocation across heaps after having computed it for each heap individually.

Author: PeterSolMS
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

Copy link
Member

@Maoni0 Maoni0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@PeterSolMS PeterSolMS merged commit 801e81e into dotnet:main Mar 10, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants