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

Enable trimming TLS arrays in ArrayPool.Shared #56316

Merged
merged 3 commits into from
Jul 31, 2021

Commits on Jul 31, 2021

  1. Enable trimming TLS arrays in ArrayPool.Shared

    Today arrays stored in `ArrayPool<T>.Shared`'s per-core buckets have trimming applied, but arrays stored in the per-thread buckets are only trimmed when there's high memory pressure.  This change enables all buffers to be trimmed (eventually).  Every time our gen2 callback runs, it ensures any non-timestamped buffers have a timestamp, and also ensures that any timestamped buffers are still timely... if any aren't, they're eligible for trimming.  The timestamp is reset for TLS arrays when they're stored, and for per-core buckets when they transition from empty to non-empty; the latter is just a tweak on the current behavior, which incurs the cost of Environment.TickCount upon that transition, whereas now we only pay it as part of the trimming pass.
    stephentoub committed Jul 31, 2021
    Configuration menu
    Copy the full SHA
    9dfc854 View commit details
    Browse the repository at this point in the history
  2. Address PR feedback

    stephentoub committed Jul 31, 2021
    Configuration menu
    Copy the full SHA
    de909a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4ea83d2 View commit details
    Browse the repository at this point in the history