-
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.GetAllocatedBytesForCurrentThread always returns 0 when processor affinity is set to single proc #10547
Comments
Yes, this is how the API was implemented. Setting affinity to single proc will disable allocation contexts, that in turn makes this API to always return 0. I have pointed this non-intuitive behavior when this API was introduced: dotnet/coreclr#6953 (comment). I agree that the current behavior does not sound right: |
@jkotas once again big thanks for help! I am going to close this issue and open a new one with a list of requirements that we have once I finish porting all repositories and the requirements are crystal clear. |
I think we should keep this issue opened. It is a bug that we should look into fixing. |
Compared to other issues, this is not a ship-stopper for 3.0 |
moving to 7 |
Fyi - this appears to affect all Azure Websites. |
When the processor affinity is set in explicit way
GC.GetAllocatedBytesForCurrentThread
always returns 0. Even is something was allocated.@jkotas @Maoni0 is this expected behavior? am I doing something wrong?
I am porting CoreCLR benchmarks from xunit-performance to BenchmarkDotNet and I have faced this issue today when I was comparing the results of some unstable benchmarks with affinity set and without.
/cc @jorive
The text was updated successfully, but these errors were encountered: