Skip to content

Epic: GC Regions Support #43844

@mangod9

Description

@mangod9

AB#1244342
We are switching segments to regions for managing memory on the GC heap. Segments have their own benefits, eg, checking if an address is in ephemeral requires comparing with 2 values (in Workstation case) but regions enable many optimizations that we've been wanting to have for a while. For example -

  • Currently there’s no way to exchange memory between different generations without a compacting GC so if BGC builds up a lot of free space in gen2/LOH and gen2 has a lot more free spaces than LOH, there’s not a way to repurpose memory in gen2 for LOH. Another example is we often observe a lot of free spaces in gen0 due to pinning and we cannot repurpose it for other generations. With regions we can repurpose empty regions to any generation which will solve both problems. We could also choose to decommit these free spaces but that would require its own bookkeeping and we might as well just switch to regions.
  • This will also help with container perf - because we repurpose free spaces to other generations, we can regulate the memory usage much more easily without incurring full compacting GCs.
  • One of the evolutions I’d like to make in GC is to decouple the GC threads and their respective heaps and this will allow that to happen a lot more naturally.
  • This will build a solid foundation for new flavors of GCs like incremental/concurrent compacting GCs.

Functionality

  • Enable support wks
  • Enable support srv
  • Enable Regions by default in Standalone GC (clrgc.dll)

Testing

  • P0/P1 Tests passing
  • CI/CD InnerLoop Testing enabled with Regions
  • CI/CD OuterLoop Testing enabled with Regions
  • CI/CD Stress testing enabled

Stability

  • Basic tests passing rate > 99%
  • GCStress tests passing rate > 99%
  • All tests passing rate > 99.9%

Performance

  • TE Performance is comparable to segments
  • Micro benchmarks dont show any major performance regressions.

Release

  • CLRGC available within installers/gzips.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bottom Up WorkNot part of a theme, epic, or user storyUser StoryA single user-facing feature. Can be grouped under an epic.area-GC-coreclr

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions