Preparing for the .NET 10 GC
a day ago
- #.NET
- #GC
- #Performance
- DATAS (Dynamic Adaptation To Application Size) is enabled by default in .NET 10, a significant change from .NET 9.
- DATAS aims to adapt the heap size to the application's live data size (LDS), making memory usage more predictable across different core counts.
- Server GC traditionally does not adapt to application size, leading to varying heap sizes based on the number of cores, whereas DATAS provides consistent heap sizes.
- DATAS is particularly beneficial for bursty workloads in memory-constrained environments and small workloads using Server GC.
- Performance trade-offs with DATAS include potential throughput regressions and higher startup times due to starting with a single heap.
- DATAS can be tuned using configurations like GCDTargetTCP, GCDGen0GrowthPercent, and GCDGen0GrowthMinFactor to balance memory usage and performance.
- Scenarios where DATAS may not be suitable include applications with no use for freed memory, critical startup performance requirements, and workloads with mostly gen2 GCs.
- Tuning examples show how adjusting DATAS configurations can mitigate throughput regressions and optimize performance for specific workloads.
- DATAS events provide detailed metrics for advanced analysis, though most users can rely on approximations for performance investigations.