-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
GC sometimes reports survival rates above 100% #100594
Comments
Tagging subscribers to this area: @dotnet/gc |
markples
added a commit
that referenced
this issue
May 2, 2024
The survival rate calculation for BGCs includes objects allocated during the BGC in the numerator but not denominator. This fixes that by adding them to size_before. The existing counters are reset mid-BGC, so the mark and sweep phases need to be added at separate points. I verified the fix over several gcperfsim runs and watched the counters getting updated in the debugger. This includes some new and moved comments from going through the phases of BGC and putting similarly ifdef-ed code together. Partial fix for #100594
This issue is still relevant for ephemeral generations, but the impact there is closer to rounding error than the large swings that can be seen in LOH (due to the small -number- of allocations). |
michaelgsharp
pushed a commit
to michaelgsharp/runtime
that referenced
this issue
May 9, 2024
The survival rate calculation for BGCs includes objects allocated during the BGC in the numerator but not denominator. This fixes that by adding them to size_before. The existing counters are reset mid-BGC, so the mark and sweep phases need to be added at separate points. I verified the fix over several gcperfsim runs and watched the counters getting updated in the debugger. This includes some new and moved comments from going through the phases of BGC and putting similarly ifdef-ed code together. Partial fix for dotnet#100594
Ruihan-Yin
pushed a commit
to Ruihan-Yin/runtime
that referenced
this issue
May 30, 2024
The survival rate calculation for BGCs includes objects allocated during the BGC in the numerator but not denominator. This fixes that by adding them to size_before. The existing counters are reset mid-BGC, so the mark and sweep phases need to be added at separate points. I verified the fix over several gcperfsim runs and watched the counters getting updated in the debugger. This includes some new and moved comments from going through the phases of BGC and putting similarly ifdef-ed code together. Partial fix for dotnet#100594
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easiest repro is to only allocate large objects -
gcperfsim -tc 36 -tagb 100 -tlgb 0 -lohar 1000 -pohar 0 -sohsr 100-4000 -lohsr 16002400-16004800 -pohsr 100-204800 -sohsi 0 -lohsi 0 -pohsi 0 -sohpi 0 -lohpi 0 -sohfi 0 -lohfi 0 -pohfi 0 -allocType reference -testKind time
- but this requires a separate gcperfsim fix.This is due to allocations occurring during BGC. They are counted as survived but not at the start (i.e., in the numerator but not the denominator). It looks like inaccuracies are possible for all generations, but it easiest to expose it as >100% with large objects.
The text was updated successfully, but these errors were encountered: