-
Notifications
You must be signed in to change notification settings - Fork 5k
Gen-0 collections happens more frequently on macOS #12717
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
Comments
cc: @Maoni0 |
This does not happen on Ubuntu 18.04 (added results to the OP) nor Windows. |
Can confirm that on windows and linux, there is a decrease in gen0 collections with
(Building in debug mode, otherwise the code is optimized away for |
@Andy-MS on mac I get: With Lazy:
With ConcurrentQueue:
|
@smoogipoo Thanks, I got access to a mac and can easily reproduce this with just |
* Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac In a previous PR (ed52a00#diff-8447e54277bb962d167a77bb260760d7R1879), GetCacheSizePerLogicalCpu was changed to no longer rely on cpuid on amd64 systems; instead it uses GetLogicalProcessorCacheSizeFromOS(). Unfortunately that function consisted of a number of `#if`s, none of which were active on macs, and we just returned 0. This caused us to default to a gen0size of only 0.25MB, causing many GCs. Fixed by adding a new case that uses `sysctlbyname`. Fix #24658 * Fixes from code review * Check for function sysctlbyname instead of header
Is the fix for this supposed to be in preview 6? These are the current stats for construction of
|
This is not in Preview 6. It was merged too late. It is included into Preview 7. |
We've observed the GC running much more frequently on .NET Core 3.0 preview 5 than .NET Core 2.2.5 on macOS.
The data I provide may be replicated via the following benchmark:
This is not only exhibited by
ConcurrentQueue
; for example,Lazy
experiences a similar ~10x increase in Gen 0 collections per 1000 instances.I'm unsure of how to debug this further (please let me know how to, if required) - going this deep into the CLR without memory profiling tools on macOS is outside of my area of expertise at the moment.
The text was updated successfully, but these errors were encountered: