23 references to CollectionCount
Microsoft.Extensions.Telemetry.PerformanceTests (6)
SustainedGcPressureMeasurement.cs (6)
156int gen0Before = GC.CollectionCount(0); 157int gen1Before = GC.CollectionCount(1); 158int gen2Before = GC.CollectionCount(2); 209int gen0Collections = GC.CollectionCount(0) - gen0Before; 210int gen1Collections = GC.CollectionCount(1) - gen1Before; 211int gen2Collections = GC.CollectionCount(2) - gen2Before;
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\RuntimeMetrics.cs (1)
165long collectionsFromThisGeneration = GC.CollectionCount(gen);
System.Diagnostics.TraceSource (4)
System\Diagnostics\Switch.cs (2)
65if (s_LastCollectionCount != GC.CollectionCount(2)) 81s_LastCollectionCount = GC.CollectionCount(2);
System\Diagnostics\TraceSource.cs (2)
47if (s_LastCollectionCount != GC.CollectionCount(2)) 63s_LastCollectionCount = GC.CollectionCount(2);
System.Private.CoreLib (5)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (3)
82_gen0GCCounter ??= new IncrementingPollingCounter("gen-0-gc-count", this, () => GC.CollectionCount(0)) { DisplayName = "Gen 0 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 83_gen1GCCounter ??= new IncrementingPollingCounter("gen-1-gc-count", this, () => GC.CollectionCount(1)) { DisplayName = "Gen 1 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 84_gen2GCCounter ??= new IncrementingPollingCounter("gen-2-gc-count", this, () => GC.CollectionCount(2)) { DisplayName = "Gen 2 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) };
src\runtime\src\libraries\System.Private.CoreLib\src\System\GC.cs (2)
48if (s_gcCounts[2] != CollectionCount(2)) 52s_gcCounts[i] = CollectionCount(i);
System.Runtime.Caching (4)
System\Runtime\Caching\CacheMemoryMonitor.cs (2)
43_gen2Count = GC.CollectionCount(2); 158int gen2Count = GC.CollectionCount(2);
System\Runtime\Caching\MemoryCacheStatistics.cs (2)
105int gen2Count = GC.CollectionCount(2); 200int gen2Count = GC.CollectionCount(2);
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\HandleCollector.cs (3)
78(_gcCounts[collectionGeneration] == GC.CollectionCount(collectionGeneration)))) 87_gcCounts[i] = GC.CollectionCount(i); 118_gcCounts[i] = GC.CollectionCount(i);