1110 references to GC
AnalyzerRunner (3)
PerformanceTracker.cs (3)
30var initialTotalAllocatedBytes = GC.GetTotalAllocatedBytes(preciseMemory); 41public long AllocatedBytes => GC.GetTotalAllocatedBytes(true) - _initialTotalAllocatedBytes; 50var allocatedBytes = GC.GetTotalAllocatedBytes(preciseMemory) - _initialTotalAllocatedBytes;
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceSubscriber.cs (1)
82GC.SuppressFinalize(this);
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\DiagnosticSourceSubscriber.cs (1)
82GC.SuppressFinalize(this);
csc (1)
src\Compilers\Shared\BuildClient.cs (1)
333GC.SuppressFinalize(npcs);
dotnet-svcutil-lib (6)
FrameworkFork\Microsoft.CodeDom\Compiler\TempFiles.cs (1)
71GC.SuppressFinalize(this);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlElementList.cs (1)
270GC.SuppressFinalize(this);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (2)
1464GC.SuppressFinalize(this); 1499GC.SuppressFinalize(this);
FrameworkFork\System.ServiceModel\SMDiagnostics\System\ServiceModel\Diagnostics\Activity.cs (1)
44GC.SuppressFinalize(this);
FrameworkFork\System.ServiceModel\System\ServiceModel\Diagnostics\ServiceModelActivity.cs (1)
288GC.SuppressFinalize(this);
HealthChecksSample (4)
GCInfoHealthCheck.cs (4)
57var allocated = GC.GetTotalMemory(forceFullCollection: false); 61{ "Gen0Collections", GC.CollectionCount(0) }, 62{ "Gen1Collections", GC.CollectionCount(1) }, 63{ "Gen2Collections", GC.CollectionCount(2) },
HttpStress (1)
Program.cs (1)
626GC.KeepAlive(listener);
IdeCoreBenchmarks (4)
NavigateToBenchmarks.cs (4)
129GC.Collect(0, GCCollectionMode.Forced, blocking: true); 130GC.Collect(1, GCCollectionMode.Forced, blocking: true); 131GC.Collect(2, GCCollectionMode.Forced, blocking: true); 135GC.KeepAlive(roots);
InMemory.FunctionalTests (1)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsersRendererTypesInMethodBody.cs (2)
14GC.KeepAlive(test); 17GC.KeepAlive(/*MMProperty*/frame.Component);
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
EndpointHtmlRendererTest.cs (1)
1529builder.AddAttribute(1, "onsubmit", () => { GC.KeepAlive(new object()); });
Microsoft.AspNetCore.Components.Performance (1)
RenderTreeDiffBuilderBenchmark.cs (1)
83GC.KeepAlive(diff);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
TestFiles\ComponentInternalUsageDiagnosticsAnalyzerTest\UsersRendererTypesInMethodBody.cs (2)
14GC.KeepAlive(test); 17GC.KeepAlive(/*MMProperty*/frame.Component);
Microsoft.AspNetCore.Components.Tests (1)
RendererTest.cs (1)
5916GC.KeepAlive(unrelatedThingToMakeTheLambdaCapture);
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHost.cs (1)
51GC.KeepAlive(typeof(JSInteropMethods));
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Hosting\RootComponentMappingTest.cs (1)
20GC.KeepAlive(mapping);
Microsoft.AspNetCore.Components.WebView (1)
WebViewManager.cs (1)
273GC.SuppressFinalize(this);
Microsoft.AspNetCore.Components.WebView.Wpf (1)
BlazorWebView.cs (1)
413 GC.SuppressFinalize(this);
Microsoft.AspNetCore.Cryptography.Internal.Tests (2)
UnsafeBufferUtilTests.cs (2)
58GC.KeepAlive(testHandle); 99GC.KeepAlive(testHandle);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
597GC.KeepAlive(expectedParameterValue);
Microsoft.AspNetCore.Http.Microbenchmarks (14)
RouteValueDictionaryBenchmark.cs (14)
232GC.KeepAlive(kvp.Value); 243GC.KeepAlive(kvp.Value); 252GC.KeepAlive(dictionary["action"]); 253GC.KeepAlive(dictionary["controller"]); 254GC.KeepAlive(dictionary["id"]); 262GC.KeepAlive(dictionary["action"]); 263GC.KeepAlive(dictionary["controller"]); 264GC.KeepAlive(dictionary["id"]); 305GC.KeepAlive(action); 306GC.KeepAlive(controller); 307GC.KeepAlive(id); 318GC.KeepAlive(action); 319GC.KeepAlive(controller); 320GC.KeepAlive(id);
Microsoft.AspNetCore.InternalTesting (1)
CultureReplacer.cs (1)
66GC.SuppressFinalize(this);
Microsoft.AspNetCore.Mvc.Core.Test (2)
ApplicationModels\DefaultApplicationModelProviderTest.cs (2)
1532GC.SuppressFinalize(this); 1549GC.SuppressFinalize(this);
Microsoft.AspNetCore.Mvc.Testing (2)
WebApplicationFactory.cs (2)
537GC.SuppressFinalize(this); 604GC.SuppressFinalize(this);
Microsoft.AspNetCore.Routing.Microbenchmarks (15)
EndpointMetadataCollectionBenchmark.cs (15)
49GC.KeepAlive(_items[i] as IMetadata1); 54GC.KeepAlive(_items[i] as IMetadata2); 59GC.KeepAlive(_items[i] as IMetadata3); 64GC.KeepAlive(_items[i] as IMetadata4); 69GC.KeepAlive(_items[i] as IMetadata5); 76GC.KeepAlive(_collection.GetMetadata<IMetadata1>()); 77GC.KeepAlive(_collection.GetMetadata<IMetadata2>()); 78GC.KeepAlive(_collection.GetMetadata<IMetadata3>()); 79GC.KeepAlive(_collection.GetMetadata<IMetadata4>()); 80GC.KeepAlive(_collection.GetMetadata<IMetadata5>()); 88GC.KeepAlive(item); 93GC.KeepAlive(item); 98GC.KeepAlive(item); 103GC.KeepAlive(item); 108GC.KeepAlive(item);
Microsoft.AspNetCore.Routing.Tests (4)
DataSourceDependentCacheTest.cs (1)
45GC.KeepAlive(cache.Value);
Matching\BarebonesMatcherConformanceTest.cs (1)
34GC.KeepAlive(new object[] { template, path, keys, values });
Matching\FullFeaturedMatcherConformanceTest.cs (2)
190GC.KeepAlive(keys); 191GC.KeepAlive(values);
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Server.IIS (2)
Core\IISNativeApplication.cs (1)
62GC.SuppressFinalize(this);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISExpressDeployer.cs (1)
474public void OnInvoked() => GC.KeepAlive(_handle.Wrapper);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Infrastructure\Disposable.cs (1)
38GC.SuppressFinalize(this);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (4)
HttpConnectionManagerTests.cs (3)
28GC.Collect(); 29GC.WaitForPendingFinalizers(); 59GC.KeepAlive(httpConnection);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
QuicConnectionListenerTests.cs (2)
411GC.Collect(); 412GC.WaitForPendingFinalizers();
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
17var pinnedArray = GC.AllocateUninitializedArray<byte>(length, pinned: true);
Microsoft.AspNetCore.SignalR.Client.Tests (2)
TimerAwaitableTests.cs (2)
21GC.Collect(); 22GC.WaitForPendingFinalizers();
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyLaunchManager.cs (1)
375GC.SuppressFinalize(this);
Microsoft.Build (8)
BackEnd\BuildManager\BuildManager.cs (1)
1175GC.SuppressFinalize(this);
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
887GC.Collect();
BackEnd\Components\Caching\RegisteredTaskObjectCache.cs (1)
52GC.SuppressFinalize(this);
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
344GC.SuppressFinalize(this);
BackEnd\Node\OutOfProcNode.cs (1)
555GC.Collect();
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (1)
237GC.SuppressFinalize(this);
Definition\ProjectCollection.cs (1)
1501GC.SuppressFinalize(this);
PrintLineDebugger.cs (1)
61GC.SuppressFinalize(this);
Microsoft.Build.Engine.OM.UnitTests (2)
Construction\ProjectFormatting_Tests.cs (1)
37GC.Collect();
PrintLineDebugger.cs (1)
61GC.SuppressFinalize(this);
Microsoft.Build.Engine.UnitTests (14)
BackEnd\BuildEventArgTransportSink_Tests.cs (2)
138GC.Collect(); 139GC.WaitForPendingFinalizers();
BackEnd\TargetUpToDateChecker_Tests.cs (1)
41GC.Collect();
Evaluation\EvaluationLogging_Tests.cs (2)
29GC.Collect(); 38GC.Collect();
Evaluation\Evaluator_Tests.cs (2)
41GC.Collect(); 50GC.Collect();
Evaluation\ItemEvaluation_Tests.cs (2)
31GC.Collect(); 40GC.Collect();
Evaluation\Preprocessor_Tests.cs (1)
38GC.Collect();
Evaluation\ProjectRootElementCache_Tests.cs (4)
31GC.Collect(); 41GC.Collect(); 89GC.Collect(); 97GC.Collect();
Microsoft.Build.Tasks.CodeAnalysis (1)
RCWForCurrentContext.cs (1)
104GC.SuppressFinalize(this);
Microsoft.Build.Tasks.Core (3)
AssemblyDependency\DisposableBase.cs (1)
47GC.SuppressFinalize(this);
BuildCacheDisposeWrapper.cs (1)
44GC.SuppressFinalize(this);
PrintLineDebugger.cs (1)
61GC.SuppressFinalize(this);
Microsoft.Build.UnitTests.Shared (2)
DummyMappedDrive.cs (1)
83GC.SuppressFinalize(this);
TestEnvironment.cs (1)
73GC.SuppressFinalize(this);
Microsoft.Build.Utilities.Core (1)
PrintLineDebugger.cs (1)
61GC.SuppressFinalize(this);
Microsoft.Cci.Extensions (1)
Writers\Syntax\TokenSyntaxWriter.cs (1)
82GC.SuppressFinalize(this);
Microsoft.CodeAnalysis (2)
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (1)
80GC.SuppressFinalize(this);
ReferenceManager\CommonReferenceManager.Resolution.cs (1)
367GC.KeepAlive(assemblyMetadata);
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (2)
206var gcType = compilation.GetTypeByMetadataName(typeof(GC).FullName!); 213nameof(GC.SuppressFinalize)),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (62)
Compilation\ReferenceManagerTests.cs (1)
1414GC.KeepAlive(symbolA2);
Symbols\Metadata\PE\NoPia.cs (40)
340GC.KeepAlive(localTypes1_1); 341GC.KeepAlive(localTypes2_1); 342GC.KeepAlive(pia1_1); 343GC.KeepAlive(localTypes1_9); 344GC.KeepAlive(library1_9); 677GC.KeepAlive(localTypes1_1); 678GC.KeepAlive(localTypes2_1); 679GC.KeepAlive(pia1_1); 680GC.KeepAlive(localTypes1_9); 681GC.KeepAlive(library1_9); 701GC.KeepAlive(tc1); 702GC.KeepAlive(tc2); 860GC.KeepAlive(tc1); 861GC.KeepAlive(tc2); 862GC.KeepAlive(tc3); 863GC.KeepAlive(tc4); 864GC.KeepAlive(tc5); 865GC.KeepAlive(tc6); 866GC.KeepAlive(tc7); 938GC.KeepAlive(tc1); 939GC.KeepAlive(tc2); 940GC.KeepAlive(tc3); 941GC.KeepAlive(tc4); 942GC.KeepAlive(tc5); 943GC.KeepAlive(tc6); 944GC.KeepAlive(tc7); 1227GC.KeepAlive(tc1); 1228GC.KeepAlive(tc2); 1229GC.KeepAlive(tc3); 1230GC.KeepAlive(tc4); 1231GC.KeepAlive(tc5); 1232GC.KeepAlive(tc6); 1233GC.KeepAlive(tc7); 1343GC.KeepAlive(tc1); 1344GC.KeepAlive(tc2); 1345GC.KeepAlive(tc3); 1346GC.KeepAlive(tc4); 1347GC.KeepAlive(tc5); 1348GC.KeepAlive(tc6); 1349GC.KeepAlive(tc7);
Symbols\Retargeting\NoPia.cs (21)
639GC.KeepAlive(localTypes1_1); 640GC.KeepAlive(localTypes2_1); 641GC.KeepAlive(pia1_1); 642GC.KeepAlive(localTypes1_9); 643GC.KeepAlive(library1_9); 940GC.KeepAlive(localTypes1_1); 941GC.KeepAlive(localTypes2_1); 942GC.KeepAlive(pia1_1); 943GC.KeepAlive(localTypes1_9); 944GC.KeepAlive(library1_9); 1244GC.KeepAlive(localTypes1_1); 1245GC.KeepAlive(localTypes2_1); 1246GC.KeepAlive(pia1_1); 1247GC.KeepAlive(localTypes1_9); 1248GC.KeepAlive(library1_9); 1272GC.KeepAlive(tc1); 1273GC.KeepAlive(tc2); 1298GC.KeepAlive(tc1); 1299GC.KeepAlive(tc2); 1328GC.KeepAlive(tc1); 1329GC.KeepAlive(tc2);
Microsoft.CodeAnalysis.EditorFeatures (1)
Tagging\AbstractAsynchronousTaggerProvider.TagSource.cs (1)
250GC.SuppressFinalize(this);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Threading\StaTaskScheduler.cs (2)
56GC.Collect(); 57GC.WaitForPendingFinalizers();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Preview\PreviewWorkspaceTests.cs (1)
160GC.KeepAlive(exportProvider);
Utilities\AsynchronousOperationListenerTests.cs (1)
53GC.SuppressFinalize(this);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
InlineRename\UI\Adornment\RenameFlyoutViewModel.cs (1)
246GC.SuppressFinalize(this);
Preview\DifferenceViewerPreview.cs (1)
65GC.SuppressFinalize(this);
Microsoft.CodeAnalysis.Features (8)
AddImport\AbstractAddImportFeatureService.cs (1)
122GC.KeepAlive(semanticModel);
Completion\CompletionService.cs (2)
225GC.KeepAlive(semanticModel); 261GC.KeepAlive(semanticModel);
Completion\CompletionService_GetCompletions.cs (1)
119GC.KeepAlive(semanticModel);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
399GC.KeepAlive(compilation);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
245GC.KeepAlive(compilation);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (2)
206var gcType = compilation.GetTypeByMetadataName(typeof(GC).FullName!); 213nameof(GC.SuppressFinalize)),
Microsoft.CodeAnalysis.InteractiveHost (1)
Interactive\Core\InteractiveHost.cs (1)
120GC.SuppressFinalize(this);
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Features\Diagnostics\DocumentAnalysisExecutor.cs (6)
360GC.KeepAlive(rangeDeclaractionDiagnostics); 361GC.KeepAlive(rangeMethodBodyDiagnostics); 362GC.KeepAlive(rangeDiagnostics); 363GC.KeepAlive(wholeDeclarationDiagnostics); 364GC.KeepAlive(wholeMethodBodyDiagnostics); 365GC.KeepAlive(wholeDiagnostics);
Microsoft.CodeAnalysis.Scripting (1)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
162GC.SuppressFinalize(this);
Microsoft.CodeAnalysis.Test.Utilities (4)
ObjectReference.cs (3)
141GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true, compacting: true); 142GC.WaitForPendingFinalizers();
PDB\TestMetadataReferenceInfo.cs (1)
84GC.SuppressFinalize(this);
Microsoft.CodeAnalysis.UnitTests (11)
Collections\List\ICollection.Generic.Tests.cs (2)
363GC.Collect(); 366GC.KeepAlive(collection);
InternalUtilities\WeakListTests.cs (5)
102GC.KeepAlive(b.GetReference()); 204GC.KeepAlive(b); 244GC.KeepAlive(b); 284GC.KeepAlive(b); 316GC.KeepAlive(b);
MetadataReferences\FusionAssemblyPortabilityPolicy.cs (1)
70GC.SuppressFinalize(this);
Text\TextChangeTests.cs (3)
558GC.Collect(2, GCCollectionMode.Forced, blocking: true); 1266GC.Collect(2); 1267GC.WaitForFullGCComplete();
Microsoft.CodeAnalysis.Workspaces (12)
FindSymbols\ReferenceLocationExtensions.cs (1)
41GC.KeepAlive(compilation);
Remote\IRemoteKeepAliveService.cs (1)
79GC.SuppressFinalize(this);
TemporaryStorage\TemporaryStorageService.MemoryMappedInfo.cs (2)
135GC.GetTotalMemory(forceFullCollection: true); 139GC.Collect();
Workspace\Solution\DocumentState.cs (8)
691GC.KeepAlive(newTreeContent); 692GC.KeepAlive(newTextContent); 693GC.KeepAlive(oldTreeContent); 694GC.KeepAlive(oldTextContent); 696GC.KeepAlive(newTree); 697GC.KeepAlive(newText); 698GC.KeepAlive(oldTree); 699GC.KeepAlive(oldText);
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
SolutionTests\SolutionTests.cs (1)
5483GC.KeepAlive(finalSolution);
WorkspaceServiceTests\TemporaryStorageServiceTests.cs (3)
138GC.Collect(2); 139GC.WaitForPendingFinalizers(); 140GC.Collect(2);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
593GC.KeepAlive(exportProvider);
Microsoft.Data.Analysis (1)
TextFieldParser.cs (1)
504GC.SuppressFinalize(this);
Microsoft.Data.Analysis.Tests (2)
src\Microsoft.Data.Analysis\TextFieldParser.cs (1)
504GC.SuppressFinalize(this);
test\Microsoft.ML.TestFramework\BaseTestClass.cs (1)
93GC.Collect(2, GCCollectionMode.Forced, true);
Microsoft.DotNet.AsmDiff (1)
Csv\CsvWriter.cs (1)
21GC.SuppressFinalize(this);
Microsoft.DotNet.RemoteExecutor (1)
RemoteInvokeHandle.cs (1)
54GC.SuppressFinalize(this); // before Dispose(true) in case the Dispose call throws
Microsoft.Extensions.Caching.Memory (1)
MemoryCache.cs (1)
638GC.SuppressFinalize(this);
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
ManualHealthCheck.cs (1)
47GC.SuppressFinalize(this);
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLoggerProvider.cs (1)
83GC.SuppressFinalize(this);
Microsoft.Extensions.FileProviders.Physical (2)
PhysicalFileProvider.cs (1)
204GC.SuppressFinalize(this);
PhysicalFilesWatcher.cs (1)
252GC.SuppressFinalize(this);
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Telemetry\DownstreamDependencyMetadataManagerTests.cs (1)
94GC.SuppressFinalize(this);
Microsoft.Extensions.Identity.Core (2)
RoleManager.cs (1)
375GC.SuppressFinalize(this);
UserManager.cs (1)
398GC.SuppressFinalize(this);
Microsoft.Extensions.ObjectPool (1)
LeakTrackingObjectPool.cs (1)
71GC.SuppressFinalize(this);
Microsoft.Extensions.TimeProvider.Testing (2)
Timer.cs (2)
78GC.SuppressFinalize(this); 84GC.SuppressFinalize(this);
Microsoft.Gen.Logging.Generated.Tests (1)
Utils.cs (1)
57GC.SuppressFinalize(this);
Microsoft.Gen.Metrics.Generated.Tests (1)
MetricTests.cs (1)
44GC.SuppressFinalize(this);
Microsoft.Maui (1)
Animations\AnimationManager.cs (1)
127 GC.SuppressFinalize(this);
Microsoft.Maui.Controls (2)
Handlers\Items\iOS\CarouselViewController.cs (1)
719 GC.SuppressFinalize(this);
Handlers\Items2\iOS\CarouselViewController2.cs (1)
651 GC.SuppressFinalize(this);
Microsoft.Maui.Controls.Compatibility (1)
iOS\CollectionView\CarouselViewController.cs (1)
528 GC.SuppressFinalize(this);
Microsoft.ML.AutoML (2)
AutoMLExperiment\IPerformanceMonitor.cs (2)
155GC.AddMemoryPressure(Convert.ToInt64(metrics.PeakMemoryUsage) * 1024 * 1024); 156GC.Collect();
Microsoft.ML.Core (2)
Data\Repository.cs (2)
118GC.SuppressFinalize(this); 145GC.SuppressFinalize(this);
Microsoft.ML.Data (1)
Data\SlotCursor.cs (1)
64GC.SuppressFinalize(this);
Microsoft.ML.DataView (1)
IDataView.cs (1)
168GC.SuppressFinalize(this);
Microsoft.ML.FastTree (3)
FastTree.cs (3)
351GC.Collect(2, GCCollectionMode.Forced); 352GC.Collect(2, GCCollectionMode.Forced); 451ch.Trace("GC Total Memory = {0} MB", GC.GetTotalMemory(true) / 1024 / 1024);
Microsoft.ML.OnnxTransformer (1)
OnnxUtils.cs (1)
463GC.SuppressFinalize(this);
Microsoft.ML.Parquet (1)
ParquetLoader.cs (1)
669GC.SuppressFinalize(this);
Microsoft.ML.Recommender (1)
SafeTrainingAndModelBuffer.cs (1)
245GC.SuppressFinalize(this);
Microsoft.ML.StandardTrainers (1)
Optimizer\Optimizer.cs (1)
332long totalMem = GC.GetTotalMemory(true);
Microsoft.ML.TestFramework (1)
BaseTestClass.cs (1)
93GC.Collect(2, GCCollectionMode.Forced, true);
Microsoft.ML.Tokenizers.Tests (2)
TiktokenTests.cs (2)
508long allocation = GC.GetAllocatedBytesForCurrentThread(); 517allocation = GC.GetAllocatedBytesForCurrentThread() - allocation;
Microsoft.ML.TorchSharp (3)
AutoFormerV2\ObjectDetectionTrainer.cs (1)
1014GC.SuppressFinalize(this);
Roberta\QATrainer.cs (1)
968GC.SuppressFinalize(this);
TorchSharpBaseTrainer.cs (1)
579GC.SuppressFinalize(this);
Microsoft.NET.StringTools (1)
WeakStringCache.cs (1)
111GC.SuppressFinalize(this);
Microsoft.NET.StringTools.net35 (1)
WeakStringCache.cs (1)
111GC.SuppressFinalize(this);
Microsoft.NET.StringTools.net35.UnitTests (3)
WeakStringCache_Tests.cs (3)
66GC.Collect(); 137GC.Collect(); 167GC.Collect();
Microsoft.NET.StringTools.UnitTests (3)
WeakStringCache_Tests.cs (3)
66GC.Collect(); 137GC.Collect(); 167GC.Collect();
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (1)
468GC.SuppressFinalize(Me)
Microsoft.VisualStudio.LanguageServices (7)
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.cs (1)
94GC.KeepAlive(enabledExtensions);
LanguageService\AbstractLanguageService`2.cs (1)
128GC.SuppressFinalize(this);
ProjectSystem\FileChangeTracker.cs (1)
193GC.SuppressFinalize(this);
ProjectSystem\InvisibleEditor.cs (1)
180GC.SuppressFinalize(this);
Snippets\SnippetExpansionClient.cs (1)
757GC.KeepAlive(compilation);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (2)
97GC.SuppressFinalize(this); 121GC.SuppressFinalize(this);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
PersistentStorage\SQLiteV2PersistentStorageTests.cs (2)
57GC.Collect(); 58GC.WaitForPendingFinalizers();
MSBuild (1)
PrintLineDebugger.cs (1)
61GC.SuppressFinalize(this);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
243[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.GC))]
netstandard (1)
netstandard.cs (1)
811[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.GC))]
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationCore\System\Windows\Media\StreamGeometryContext.cs (1)
62GC.SuppressFinalize(this);
PresentationCore (58)
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (1)
93GC.SuppressFinalize(this); // not strictly necessary, but if we ever have a subclass with a finalizer, this will be more efficient
MS\Internal\MediaTrace.cs (1)
132GC.SuppressFinalize(this);
MS\Internal\Text\TextInterface\Factory.cs (4)
158GC.KeepAlive(this); 222GC.KeepAlive(fontFile); 223GC.KeepAlive(this); 317GC.KeepAlive(this);
MS\Internal\TextFormatting\FullTextBreakpoint.cs (2)
103GC.KeepAlive(context); 200GC.KeepAlive(this);
MS\Internal\TextFormatting\FullTextLine.cs (5)
135GC.SuppressFinalize(this); 149GC.KeepAlive(this); 298GC.SuppressFinalize(this); 312GC.KeepAlive(context); 631GC.KeepAlive(context);
MS\Internal\TextFormatting\TextFormatterImp.cs (1)
77GC.SuppressFinalize(this);
MS\Internal\TextFormatting\TextPenaltyModule.cs (3)
52GC.SuppressFinalize(this); 63GC.KeepAlive(this); 86GC.KeepAlive(this);
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\InputPane.cs (1)
232GC.SuppressFinalize(this);
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\UISettings.cs (1)
152GC.SuppressFinalize(this);
System\Windows\FreezableCollection.cs (1)
1105GC.SuppressFinalize(this);
System\Windows\Input\Cursor.cs (1)
115GC.SuppressFinalize(this);
System\Windows\Input\InputProviderSite.cs (1)
40GC.SuppressFinalize(this);
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (2)
185GC.SuppressFinalize(this); 261GC.KeepAlive(this);
System\Windows\Input\Stylus\Common\StylusDeviceBase.cs (1)
62GC.SuppressFinalize(this);
System\Windows\Input\Stylus\Common\TabletDeviceBase.cs (1)
68GC.SuppressFinalize(this);
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (1)
228GC.SuppressFinalize(this);
System\Windows\Input\Stylus\Wisp\PenContext.cs (2)
41GC.KeepAlive(this); 182GC.SuppressFinalize(this);
System\Windows\Input\Stylus\Wisp\PenThread.cs (1)
46GC.KeepAlive(this);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (2)
501GC.KeepAlive(this); 1289GC.KeepAlive(this);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (1)
360GC.SuppressFinalize(this);
System\Windows\InterOp\D3DImage.cs (1)
883GC.SuppressFinalize(this);
System\Windows\InterOp\HwndPointerInputProvider.cs (1)
109GC.SuppressFinalize(this);
System\Windows\InterOp\HwndSource.cs (1)
343GC.SuppressFinalize(this);
System\Windows\InterOp\HwndTarget.cs (1)
710GC.SuppressFinalize(this);
System\Windows\Media\CompositionTarget.cs (1)
124GC.SuppressFinalize(this);
System\Windows\Media\DrawingContext.cs (1)
93GC.SuppressFinalize(this);
System\Windows\Media\FactoryMaker.cs (1)
92GC.SuppressFinalize(this);
System\Windows\Media\Imaging\BitmapDecoder.cs (4)
90GC.SuppressFinalize(this); 135GC.SuppressFinalize(this); 184GC.SuppressFinalize(this); 1423GC.SuppressFinalize(this);
System\Windows\Media\MediaContext.cs (1)
1456GC.SuppressFinalize(this);
System\Windows\Media\MediaContextNotificationWindow.cs (1)
97GC.SuppressFinalize(this);
System\Windows\Media\SafeMILHandleMemoryPressure.cs (2)
25GC.AddMemoryPressure(_gcPressure); 40GC.RemoveMemoryPressure(_gcPressure);
System\Windows\Media\StreamGeometryContext.cs (1)
62GC.SuppressFinalize(this);
System\Windows\Media\textformatting\TextBreakpoint.cs (1)
39GC.SuppressFinalize(this);
System\Windows\Media\textformatting\TextFormatterContext.cs (1)
131GC.KeepAlive(contextInfo);
System\Windows\Media\textformatting\TextLineBreak.cs (3)
39GC.SuppressFinalize(this); 61GC.SuppressFinalize(this); 98GC.KeepAlive(this);
System\Windows\Media\textformatting\TextParagraphCache.cs (4)
73GC.SuppressFinalize(this); 89GC.KeepAlive(context); 108GC.SuppressFinalize(this); 154GC.KeepAlive(this);
PresentationFramework (66)
MS\Internal\Controls\StickyNote\StickyNoteHelper.cs (1)
73GC.SuppressFinalize(this);
MS\Internal\Data\EnumerableCollectionView.cs (1)
677GC.SuppressFinalize(this);
MS\Internal\Data\PropertyPathWorker.cs (2)
677GC.KeepAlive(target); // keep target alive during changes (bug 956831) 1823GC.SuppressFinalize(this);
MS\Internal\Data\XmlBindingWorker.cs (1)
500GC.KeepAlive(target); // keep target alive during process xml change (bug 1494812)
MS\Internal\Documents\ContentElementCollection.cs (1)
379GC.SuppressFinalize(this);
MS\Internal\Documents\DocumentGridPage.cs (1)
364GC.SuppressFinalize(this);
MS\Internal\Documents\HostedElements.cs (1)
51GC.SuppressFinalize(this);
MS\Internal\Documents\TextBoxLine.cs (1)
63GC.SuppressFinalize(this);
MS\Internal\Documents\UIElementIsland.cs (1)
169GC.SuppressFinalize(this);
MS\Internal\Printing\PrintDlgExMarshaler.cs (1)
848GC.SuppressFinalize(this);
MS\Internal\PtsHost\ContainerParagraph.cs (1)
70GC.SuppressFinalize(this);
MS\Internal\PtsHost\FloaterBaseParagraph.cs (1)
48GC.SuppressFinalize(this);
MS\Internal\PtsHost\FlowDocumentPage.cs (1)
70GC.SuppressFinalize(this);
MS\Internal\PtsHost\PageBreakRecord.cs (1)
76GC.SuppressFinalize(this);
MS\Internal\PtsHost\PtsCache.cs (2)
289GC.WaitForPendingFinalizers(); 463GC.SuppressFinalize(_contextPool[index].TextPenaltyModule);
MS\Internal\PtsHost\PtsPage.cs (1)
66GC.SuppressFinalize(this);
MS\Internal\PtsHost\StructuralCache.cs (3)
690GC.SuppressFinalize(this); 828GC.SuppressFinalize(this); 880GC.SuppressFinalize(this);
MS\Internal\PtsHost\SubpageParaClient.cs (1)
54GC.SuppressFinalize(this);
MS\Internal\PtsHost\SubpageParagraph.cs (1)
58GC.SuppressFinalize(this);
MS\Internal\PtsHost\UnmanagedHandle.cs (1)
45GC.SuppressFinalize(this);
MS\Internal\Text\Line.cs (1)
41GC.SuppressFinalize(this);
MS\Internal\Utility\MonitorWrapper.cs (1)
59GC.SuppressFinalize(this);
MS\Internal\WeakHashtable.cs (1)
92long globalMem = GC.GetTotalMemory(false);
MS\Internal\WeakObjectHashtable.cs (1)
90long globalMem = GC.GetTotalMemory(false);
MS\Internal\WindowsRuntime\Generated\WinRT\ObjectReference.cs (1)
101GC.SuppressFinalize(this);
System\Windows\Annotations\Storage\AnnotationStore.cs (1)
122GC.SuppressFinalize(this);
System\Windows\Controls\DataGrid.cs (1)
5316GC.SuppressFinalize(this);
System\Windows\Controls\DataGridColumnHeaderCollection.cs (2)
64GC.SuppressFinalize(this); 147GC.SuppressFinalize(this);
System\Windows\Controls\ItemCollection.cs (1)
2524GC.SuppressFinalize(this);
System\Windows\Controls\ItemContainerGenerator.cs (2)
1478GC.SuppressFinalize(this); 1596GC.SuppressFinalize(this);
System\Windows\Controls\ListBox.cs (1)
901GC.KeepAlive(anchorInfo);
System\Windows\Controls\TextAdaptor.cs (1)
64GC.SuppressFinalize(this);
System\Windows\Controls\VirtualizedCellInfoCollection.cs (1)
252GC.SuppressFinalize(this);
System\Windows\Data\BindingExpression.cs (5)
556GC.KeepAlive(target); // keep target alive during activation (bug 956831) 844GC.KeepAlive(target); // keep target alive during activation (bug 956831) 1033GC.KeepAlive(target); // keep target alive during activation (bug 956831) 1517GC.KeepAlive(target); // keep target alive during transfer (bug 956831) 2703GC.SuppressFinalize(this);
System\Windows\Data\CollectionView.cs (2)
2103GC.SuppressFinalize(this); 2125GC.SuppressFinalize(this);
System\Windows\Data\CollectionViewSource.cs (1)
1216GC.SuppressFinalize(this);
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (1)
631GC.SuppressFinalize(this);
System\Windows\Documents\NaturalLanguageHyphenator.cs (1)
62GC.SuppressFinalize(this);
System\Windows\Documents\NLGSpellerInterop.cs (3)
108GC.SuppressFinalize(this); 737GC.SuppressFinalize(this); 892GC.SuppressFinalize(this);
System\windows\Documents\TextEditor.cs (2)
107GC.SuppressFinalize(this); 242GC.SuppressFinalize(this);
System\windows\Documents\TextEditorContextMenu.cs (3)
548GC.SuppressFinalize(this); 556GC.SuppressFinalize(this); 642GC.SuppressFinalize(this);
System\Windows\Documents\TextElementEnumerator.cs (1)
59GC.SuppressFinalize(this);
System\Windows\Documents\TextRange.cs (1)
1858GC.SuppressFinalize(this);
System\Windows\Documents\TextStore.cs (1)
4278GC.SuppressFinalize(this);
System\Windows\Documents\WinEventHandler.cs (1)
59GC.SuppressFinalize(this);
System\Windows\Documents\WinRTSpellerInterop.cs (1)
97GC.SuppressFinalize(this);
System\Windows\Interop\HwndHost.cs (1)
62GC.SuppressFinalize(this);
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
165GC.SuppressFinalize(this);
System\Windows\Standard\MessageWindow.cs (2)
93GC.SuppressFinalize(this); 176GC.SuppressFinalize(hwndWrapper);
PresentationUI (5)
MS\Internal\Documents\Application\Document.cs (1)
125GC.SuppressFinalize(this);
MS\Internal\Documents\Application\DocumentStream.cs (1)
667GC.SuppressFinalize(this);
MS\Internal\Documents\Application\RightsController.cs (1)
430GC.SuppressFinalize(this);
MS\Internal\Documents\PeoplePickerWrapper.cs (1)
478GC.SuppressFinalize(this);
MS\Internal\Documents\RightsManagementProvider.cs (1)
981GC.SuppressFinalize(this);
ReachFramework (9)
Packaging\PartEditor.cs (1)
106GC.SuppressFinalize(this);
Packaging\XpsDocument.cs (1)
674GC.SuppressFinalize(this);
Packaging\XpsManager.cs (1)
901GC.SuppressFinalize(this);
Packaging\XpsResource.cs (1)
171GC.SuppressFinalize(this);
PrintConfig\PTManager.cs (1)
438GC.SuppressFinalize(this);
PrintConfig\PTProviderBase.cs (1)
122GC.SuppressFinalize(this);
Serialization\Manager\MetroSerializationManager.cs (1)
78GC.SuppressFinalize(this);
Serialization\Manager\ReachSerializer.cs (1)
398GC.SuppressFinalize(this);
Serialization\Manager\XpsPackagingPolicy.cs (1)
487GC.SuppressFinalize(this);
Roslyn.Test.PdbUtilities (1)
Shared\DummyMetadataImport.cs (1)
33GC.SuppressFinalize(this);
Roslyn.VisualStudio.DiagnosticsWindow (3)
OptionPages\ForceLowMemoryMode.cs (3)
149GC.Collect(GC.MaxGeneration); 150GC.WaitForPendingFinalizers();
Roslyn.VisualStudio.Next.UnitTests (1)
Services\SolutionAssetCacheTests.cs (1)
26GC.Collect();
ScenarioTests.Common.Tests (1)
ScenarioTestTypes.cs (1)
1234GC.SuppressFinalize(this);
System.CodeDom (1)
src\libraries\Common\src\System\IO\TempFileCollection.cs (1)
47GC.SuppressFinalize(this);
System.Collections.Concurrent (1)
System\Collections\Concurrent\BlockingCollection.cs (1)
1493GC.SuppressFinalize(this);
System.Collections.Immutable (1)
System\Collections\Frozen\String\LengthBuckets.cs (1)
92int[] copy = GC.AllocateUninitializedArray<int>(arraySize);
System.ComponentModel.Composition (8)
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (1)
93GC.SuppressFinalize(this);
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (1)
132GC.SuppressFinalize(this);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (1)
205GC.SuppressFinalize(this);
System\ComponentModel\Composition\Hosting\ComposablePartCatalogCollection.cs (1)
251GC.SuppressFinalize(this);
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (1)
56GC.SuppressFinalize(this);
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
299GC.SuppressFinalize(this);
System\ComponentModel\Composition\Hosting\ImportEngine.cs (1)
249GC.SuppressFinalize(this);
System\ComponentModel\Composition\Primitives\ComposablePartCatalog.cs (1)
131GC.SuppressFinalize(this);
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\AsyncOperation.cs (1)
87GC.SuppressFinalize(this);
System.ComponentModel.Primitives (1)
System\ComponentModel\Component.cs (1)
74GC.SuppressFinalize(this);
System.ComponentModel.TypeConverter (7)
System\ComponentModel\Container.cs (1)
109GC.SuppressFinalize(this);
System\ComponentModel\Design\DesignerTransaction.cs (3)
32GC.SuppressFinalize(this); 48GC.SuppressFinalize(this); 81GC.SuppressFinalize(this);
System\ComponentModel\LicFileLicenseProvider.cs (1)
120GC.SuppressFinalize(this);
System\ComponentModel\MarshalByValueComponent.cs (1)
66GC.SuppressFinalize(this);
System\ComponentModel\WeakHashtable.cs (1)
62long globalMem = GC.GetTotalMemory(false);
System.Configuration.ConfigurationManager (1)
src\libraries\Common\src\System\IO\TempFileCollection.cs (1)
47GC.SuppressFinalize(this);
System.Data.Common (10)
System\Data\Common\DataAdapter.cs (1)
43GC.SuppressFinalize(this);
System\Data\Common\DbDataSource.cs (2)
78GC.SuppressFinalize(this); 86GC.SuppressFinalize(this);
System\Data\DataColumn.cs (1)
126GC.SuppressFinalize(this);
System\Data\DataSet.cs (1)
92GC.SuppressFinalize(this);
System\Data\DataTable.cs (1)
166GC.SuppressFinalize(this);
System\Data\DataView.cs (3)
99GC.SuppressFinalize(this); 132GC.SuppressFinalize(this); 165GC.SuppressFinalize(this);
System\Data\DataViewManager.cs (1)
31GC.SuppressFinalize(this);
System.Data.Odbc (7)
src\libraries\Common\src\System\Runtime\InteropServices\HandleRefMarshaller.cs (1)
22public void OnInvoked() => GC.KeepAlive(_handle.Wrapper);
System\Data\Odbc\OdbcCommand.cs (1)
46GC.SuppressFinalize(this);
System\Data\Odbc\OdbcCommandBuilder.cs (1)
14GC.SuppressFinalize(this);
System\Data\Odbc\OdbcConnection.cs (1)
891GC.KeepAlive(this);
System\Data\Odbc\OdbcConnectionHelper.cs (1)
23GC.SuppressFinalize(this);
System\Data\Odbc\OdbcDataAdapter.cs (2)
20GC.SuppressFinalize(this); 41GC.SuppressFinalize(this);
System.Diagnostics.DiagnosticSource (13)
System\Diagnostics\Activity.cs (1)
1121GC.SuppressFinalize(this);
System\Diagnostics\ActivitySource.cs (1)
69GC.KeepAlive(DiagnosticSourceEventSource.Log);
System\Diagnostics\DiagnosticListener.cs (2)
147GC.KeepAlive(DiagnosticSourceEventSource.Log); 326GC.KeepAlive("");
System\Diagnostics\Metrics\Meter.cs (1)
101GC.KeepAlive(MetricsEventSource.Log);
System\Diagnostics\Metrics\RuntimeMetrics.cs (8)
21private static readonly int s_maxGenerations = Math.Min(GC.GetGCMemoryInfo().GenerationInfo.Length, s_genNames.Length); 46() => GC.GetTotalAllocatedBytes(), 52() => GC.GetGCMemoryInfo().TotalCommittedBytes, 70() => GC.GetTotalPauseDuration().TotalSeconds, 163for (int gen = GC.MaxGeneration; gen >= 0; --gen) 165long collectionsFromThisGeneration = GC.CollectionCount(gen); 187GCMemoryInfo gcInfo = GC.GetGCMemoryInfo(); 197GCMemoryInfo gcInfo = GC.GetGCMemoryInfo();
System.Diagnostics.Process (3)
System\Diagnostics\Process.cs (2)
101GC.SuppressFinalize(this); 111GC.SuppressFinalize(this);
System\Diagnostics\ProcessWaitState.Unix.cs (1)
76GC.SuppressFinalize(this);
System.Diagnostics.TraceSource (5)
System\Diagnostics\Switch.cs (2)
76if (s_LastCollectionCount != GC.CollectionCount(2)) 92s_LastCollectionCount = GC.CollectionCount(2);
System\Diagnostics\TraceListener.cs (1)
67GC.SuppressFinalize(this);
System\Diagnostics\TraceSource.cs (2)
47if (s_LastCollectionCount != GC.CollectionCount(2)) 63s_LastCollectionCount = GC.CollectionCount(2);
System.Drawing.Common.Tests (2)
System\Drawing\BufferedGraphicsContextTests.cs (2)
221GC.Collect(); 222GC.WaitForPendingFinalizers();
System.IO.Compression (3)
System\IO\Compression\DeflateZLib\Deflater.cs (1)
72GC.SuppressFinalize(this);
System\IO\Compression\DeflateZLib\Inflater.cs (1)
228GC.SuppressFinalize(this);
System\IO\Compression\ZipArchive.cs (1)
329GC.SuppressFinalize(this);
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (1)
69GC.SuppressFinalize(this);
System.IO.MemoryMappedFiles (2)
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (1)
457GC.SuppressFinalize(this);
System\IO\MemoryMappedFiles\MemoryMappedView.cs (1)
53GC.SuppressFinalize(this);
System.IO.Packaging (2)
System\IO\Packaging\Package.cs (1)
510GC.SuppressFinalize(this);
System\IO\Packaging\PackageProperties.cs (1)
45GC.SuppressFinalize(this);
System.IO.Pipes (1)
System\IO\Pipes\AnonymousPipeServerStream.cs (1)
89GC.SuppressFinalize(_clientHandle);
System.Linq (2)
System\Linq\SegmentedArrayBuilder.cs (2)
244result = GC.AllocateUninitializedArray<T>(count); 285result = GC.AllocateUninitializedArray<T>(count);
System.Memory (1)
System\Buffers\MemoryPool.cs (1)
42GC.SuppressFinalize(this);
System.Net.Http (9)
System\Net\Http\HttpContent.cs (1)
652GC.SuppressFinalize(this);
System\Net\Http\HttpMessageHandler.cs (1)
39GC.SuppressFinalize(this);
System\Net\Http\HttpMessageInvoker.cs (1)
117GC.SuppressFinalize(this);
System\Net\Http\HttpRequestMessage.cs (1)
207GC.SuppressFinalize(this);
System\Net\Http\HttpResponseMessage.cs (1)
222GC.SuppressFinalize(this);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (1)
1844GC.SuppressFinalize(this);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
113GC.SuppressFinalize(this);
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (2)
173GC.SuppressFinalize(cleanup); 219GC.SuppressFinalize(this);
System.Net.Mail (1)
System\Net\Mail\SmtpClient.cs (1)
1001GC.SuppressFinalize(this);
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.cs (1)
41GC.SuppressFinalize(this);
System.Net.Quic (1)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
33GC.SuppressFinalize(newHandle);
System.Net.Requests (1)
System\Net\WebResponse.cs (1)
53GC.SuppressFinalize(this);
System.Net.Security (8)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
33GC.SuppressFinalize(newHandle);
src\libraries\Common\src\System\Net\Security\SafeCredentialReference.cs (1)
40GC.SuppressFinalize(this);
System\Net\Security\AuthenticatedStream.cs (1)
76GC.SuppressFinalize(this);
System\Net\Security\SslStream.IO.cs (1)
74GC.SuppressFinalize(this);
System\Net\Security\SslStreamCertificateContext.Linux.cs (4)
346GC.KeepAlive(TargetCertificate); 347GC.KeepAlive(_privateIntermediateCertificates); 348GC.KeepAlive(_rootCertificate); 349GC.KeepAlive(caCert);
System.Net.Sockets (5)
System\Net\Sockets\Socket.cs (2)
232GC.SuppressFinalize(this); 3535GC.SuppressFinalize(this);
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
516GC.SuppressFinalize(this);
System\Net\Sockets\TCPClient.cs (1)
296GC.SuppressFinalize(this);
System\Net\Sockets\UDPClient.cs (1)
245GC.SuppressFinalize(this);
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
62GC.SuppressFinalize(this);
System.Numerics.Tensors (11)
System\Numerics\Tensors\netcore\Tensor.cs (6)
97T[] values = pinned ? GC.AllocateArray<T>((int)linearLength, pinned) : (new T[linearLength]); 110T[] values = pinned ? GC.AllocateArray<T>((int)linearLength, pinned) : (new T[linearLength]); 122T[] values = GC.AllocateUninitializedArray<T>((int)linearLength, pinned); 135T[] values = GC.AllocateUninitializedArray<T>((int)linearLength, pinned); 356T[] values = _isPinned ? GC.AllocateArray<T>((int)linearLength, _isPinned) : (new T[linearLength]); 465T[] values = _isPinned ? GC.AllocateArray<T>(checked((int)s.FlattenedLength), _isPinned) : (new T[s.FlattenedLength]);
System\Numerics\Tensors\netcore\Tensor.Factory.cs (3)
28T[] values = pinned ? GC.AllocateArray<T>((int)linearLength, pinned) : (new T[linearLength]); 41T[] values = pinned ? GC.AllocateArray<T>((int)linearLength, pinned) : (new T[linearLength]); 177T[] values = GC.AllocateUninitializedArray<T>((int)linearLength, pinned);
System\Numerics\Tensors\netcore\TensorExtensions.cs (2)
2651T[] values = tensor.IsPinned ? GC.AllocateArray<T>((int)tensor._flattenedLength) : (new T[tensor._flattenedLength]); 2942T[] values = tensor.IsPinned ? GC.AllocateArray<T>((int)newSize) : (new T[newSize]);
System.Private.CoreLib (211)
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (2)
213GCMemoryInfo mi = GC.GetGCMemoryInfo(); 218public long MonitoringTotalAllocatedMemorySize => GC.GetTotalAllocatedBytes(precise: false);
src\libraries\System.Private.CoreLib\src\System\Buffers\MemoryManager.cs (1)
65GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (1)
110buffer = GC.AllocateUninitializedArray<T>(minimumLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Utilities.cs (1)
43GCMemoryInfo memoryInfo = GC.GetGCMemoryInfo();
src\libraries\System.Private.CoreLib\src\System\ComAwareWeakReference.cs (1)
143GC.SuppressFinalize(newRef);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
2950byte[] result = GC.AllocateUninitializedArray<byte>(chars.Length >> 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
125GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
1516GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (15)
89_gcHeapSizeCounter ??= new PollingCounter("gc-heap-size", this, () => ((double)GC.GetTotalMemory(false) / 1_000_000)) { DisplayName = "GC Heap Size", DisplayUnits = "MB" }; 90_gen0GCCounter ??= new IncrementingPollingCounter("gen-0-gc-count", this, () => GC.CollectionCount(0)) { DisplayName = "Gen 0 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 91_gen1GCCounter ??= new IncrementingPollingCounter("gen-1-gc-count", this, () => GC.CollectionCount(1)) { DisplayName = "Gen 1 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 92_gen2GCCounter ??= new IncrementingPollingCounter("gen-2-gc-count", this, () => GC.CollectionCount(2)) { DisplayName = "Gen 2 GC Count", DisplayRateTimeScale = new TimeSpan(0, 1, 0) }; 93_gen0BudgetCounter ??= new PollingCounter("gen-0-gc-budget", this, () => GC.GetGenerationBudget(0) / 1_000_000) { DisplayName = "Gen 0 GC Budget", DisplayUnits = "MB" }; 98_allocRateCounter ??= new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayUnits = "B", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; 101var gcInfo = GC.GetGCMemoryInfo(); 105_committedCounter ??= new PollingCounter("gc-committed", this, () => ((double)GC.GetGCMemoryInfo().TotalCommittedBytes / 1_000_000)) { DisplayName = "GC Committed Bytes", DisplayUnits = "MB" }; 107_gcTimeCounter ??= new PollingCounter("time-in-gc", this, () => GC.GetLastGCPercentTimeInGC()) { DisplayName = "% Time in GC since last GC", DisplayUnits = "%" }; 108_totalGcPauseTimeCounter ??= new IncrementingPollingCounter("total-pause-time-by-gc", this, () => GC.GetTotalPauseDuration().TotalMilliseconds) { DisplayName = "Time paused by GC", DisplayUnits = "ms" }; 109_gen0SizeCounter ??= new PollingCounter("gen-0-size", this, () => GC.GetGenerationSize(0)) { DisplayName = "Gen 0 Size", DisplayUnits = "B" }; 110_gen1SizeCounter ??= new PollingCounter("gen-1-size", this, () => GC.GetGenerationSize(1)) { DisplayName = "Gen 1 Size", DisplayUnits = "B" }; 111_gen2SizeCounter ??= new PollingCounter("gen-2-size", this, () => GC.GetGenerationSize(2)) { DisplayName = "Gen 2 Size", DisplayUnits = "B" }; 112_lohSizeCounter ??= new PollingCounter("loh-size", this, () => GC.GetGenerationSize(3)) { DisplayName = "LOH Size", DisplayUnits = "B" }; 113_pohSizeCounter ??= new PollingCounter("poh-size", this, () => GC.GetGenerationSize(4)) { DisplayName = "POH (Pinned Object Heap) Size", DisplayUnits = "B" };
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (1)
110GC.ReRegisterForFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.cs (1)
107GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\FileStream.cs (2)
57GC.SuppressFinalize(safeHandle); 529GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\Iterator.cs (1)
31GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (1)
573byte[] copy = GC.AllocateUninitializedArray<byte>(count);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (1)
1037Interlocked.CompareExchange(ref _buffer, GC.AllocateUninitializedArray<byte>(_bufferSize), null);
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (1)
164GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (2)
195GC.SuppressFinalize(this); 264GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (2)
30GC.SuppressFinalize(this); 36GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (2)
56GC.SuppressFinalize(this); 66GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
104GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\LocalDataStoreSlot.cs (1)
14GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (1)
417GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (7)
332GC.SuppressFinalize(this); 557GC.KeepAlive(this); // Ensure we don't get finalized while accessing DependentHandle 563GC.KeepAlive(this); // Ensure we don't get finalized while accessing DependentHandle 575GC.KeepAlive(this); // Ensure we don't get finalized while accessing DependentHandle 773GC.SuppressFinalize(this); 783GC.KeepAlive(this); // ensure we don't get finalized while accessing DependentHandles. 822GC.ReRegisterForFinalize(this); // next time it's finalized, we'll be sure there are no remaining refs
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CriticalHandle.cs (2)
154GC.SuppressFinalize(this); 197GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.cs (1)
51GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (3)
72GC.SuppressFinalize(this); 109GC.SuppressFinalize(this); 132GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyDependencyResolver.cs (1)
70GC.KeepAlive(errorWriter);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
97GC.SuppressFinalize(this); 427byte[] bytes = GC.AllocateUninitializedArray<byte>((int)length); 466GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (3)
124private static readonly ulong s_GCSegmentSize = GC.GetSegmentSize(); 227GC.Collect(); 301GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (7)
137m_ChunkChars = GC.AllocateUninitializedArray<char>(capacity); 163m_ChunkChars = GC.AllocateUninitializedArray<char>(capacity); 217m_ChunkChars = GC.AllocateUninitializedArray<char>(persistedCapacity); 282char[] newArray = GC.AllocateUninitializedArray<char>(newLen); 423char[] newArray = GC.AllocateUninitializedArray<char>(newLen); 2571char[] chunkChars = GC.AllocateUninitializedArray<char>(newBlockLength); 2711m_ChunkChars = GC.AllocateUninitializedArray<char>(size);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
201_readBuffer = GC.AllocateUninitializedArray<byte>(_thisEncoding.GetMaxByteCount(_readCharBufferMaxSize));
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (1)
514GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (1)
53GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (1)
613GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (4)
34GC.SuppressFinalize(this); 53GC.SuppressFinalize(this); 59GC.SuppressFinalize(this); 144GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
476GCMemoryInfo gcMemoryInfo = GC.GetGCMemoryInfo();
src\libraries\System.Private.CoreLib\src\System\Threading\PreAllocatedOverlapped.Portable.cs (1)
30GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (1)
64GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (1)
876GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
1583GC.SuppressFinalize(this); 5377GC.KeepAlive(tasks);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (2)
221GC.ReRegisterForFinalize(this); 237GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (1)
155GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (1)
1451GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (3)
805GC.SuppressFinalize(this); 811GC.SuppressFinalize(this); 818GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (1)
97GC.SuppressFinalize(this);
src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (5)
132GC.KeepAlive(this); 168GC.KeepAlive(this); 178GC.KeepAlive(this); 200GC.KeepAlive(this); 209GC.KeepAlive(this);
src\libraries\System.Private.CoreLib\src\System\WeakReference.T.cs (4)
114GC.KeepAlive(this); 123GC.KeepAlive(this); 147GC.KeepAlive(this); 157GC.KeepAlive(this);
src\System\Array.CoreCLR.cs (2)
492GC.KeepAlive(this); // Keep the method table alive 598GC.KeepAlive(this); // Keep the method table alive
src\System\Delegate.CoreCLR.cs (1)
427GC.KeepAlive(method);
src\System\Enum.CoreCLR.cs (3)
22GC.KeepAlive(rt); 30GC.KeepAlive(this); 72GC.KeepAlive(enumType);
src\System\IO\Stream.CoreCLR.cs (2)
21GC.KeepAlive(this); 35GC.KeepAlive(this);
src\System\Object.CoreCLR.cs (1)
18GC.KeepAlive(this);
src\System\Reflection\Emit\DynamicILGenerator.cs (2)
626GC.ReRegisterForFinalize(this); 649GC.ReRegisterForFinalize(this);
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
55GC.KeepAlive(methodHandle); 142GC.KeepAlive(this);
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (2)
133GC.KeepAlive(method); 143GC.KeepAlive(method);
src\System\Reflection\LoaderAllocator.cs (1)
42GC.ReRegisterForFinalize(this);
src\System\Reflection\RuntimeAssembly.cs (1)
594GC.KeepAlive(this); // We directly pass the native handle above - make sure this object stays alive for the call
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
218GC.KeepAlive(module);
src\System\Reflection\RuntimeParameterInfo.cs (2)
247GC.KeepAlive(this); 348GC.KeepAlive(this);
src\System\Reflection\RuntimePropertyInfo.cs (3)
51GC.KeepAlive(module); 72GC.KeepAlive(this); 215GC.KeepAlive(this);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (6)
49GC.KeepAlive(fldInfo); 121GC.KeepAlive(fldInfo); 216GC.KeepAlive(instantiation); 217GC.KeepAlive(methodInfo); 402GC.KeepAlive(obj); // Keep MethodTable alive 428GC.KeepAlive(array); // Keep MethodTable alive
src\System\Runtime\CompilerServices\VirtualDispatchHelpers.cs (1)
70GC.KeepAlive(obj);
src\System\Runtime\DependentHandle.cs (1)
120/// target in a local and calling <see cref="GC.KeepAlive(object)"/> on it after <see cref="Dependent"/> is accessed.
src\System\Runtime\InteropServices\Marshal.CoreCLR.cs (3)
54GC.KeepAlive(rtField); 223GC.KeepAlive(rmi); 321GC.KeepAlive(rt);
src\System\RuntimeHandles.cs (46)
230GC.KeepAlive(genericParameter); 259GC.KeepAlive(genericParameter1); 260GC.KeepAlive(genericParameter2); 283GC.KeepAlive(type); 295GC.KeepAlive(type); 426GC.KeepAlive(type); 533GC.KeepAlive(type); 553GC.KeepAlive(type); 665GC.KeepAlive(type); 666GC.KeepAlive(target); 699GC.KeepAlive(type); 744GC.KeepAlive(inst); 757GC.KeepAlive(inst); 843GC.KeepAlive(methodContext); 1027GC.KeepAlive(m_value); 1047GC.KeepAlive(method); 1062GC.KeepAlive(methodInfo); 1079GC.KeepAlive(method); 1091GC.KeepAlive(method); 1103GC.KeepAlive(method); 1113GC.KeepAlive(method); 1180GC.KeepAlive(destNullableType); // The obj instance will keep the type alive. 1196GC.KeepAlive(method); 1211GC.KeepAlive(method); 1221GC.KeepAlive(method); 1256GC.KeepAlive(method); 1271GC.KeepAlive(method); 1290GC.KeepAlive(method); 1311GC.KeepAlive(method); 1462GC.KeepAlive(field); 1500GC.KeepAlive(field); 1522GC.KeepAlive(field); 1542GC.KeepAlive(field); 1564GC.KeepAlive(field); 1585GC.KeepAlive(field); 1606GC.KeepAlive(field); 1625GC.KeepAlive(field); 1784GC.KeepAlive(typeInstantiationContext); 1785GC.KeepAlive(methodInstantiationContext); 1825GC.KeepAlive(typeInstantiationContext); 1826GC.KeepAlive(methodInstantiationContext); 1890GC.KeepAlive(typeInstantiationContext); 1891GC.KeepAlive(methodInstantiationContext); 2002GC.KeepAlive(methodHandle); 2009GC.KeepAlive(methodHandle); 2016GC.KeepAlive(fieldHandle);
src\System\RuntimeType.ActivatorCache.cs (1)
136GC.KeepAlive(rt);
src\System\RuntimeType.BoxCache.cs (1)
89GC.KeepAlive(rt);
src\System\RuntimeType.CoreCLR.cs (23)
969GC.KeepAlive(module); 1212GC.KeepAlive(module); 1394GC.KeepAlive(module); 1567GC.KeepAlive(module); 1786GC.KeepAlive(this); 1804GC.KeepAlive(methodHandle); 1936GC.KeepAlive(methodInstantiation); 1990GC.KeepAlive(field); 3314GC.KeepAlive(this); 3397GC.KeepAlive(this); // Ensure TypeHandle remains alive. 3427GC.KeepAlive(this); 3439GC.KeepAlive(this); 3455GC.KeepAlive(this); 3469GC.KeepAlive(this); 3481GC.KeepAlive(this); 3493GC.KeepAlive(this); 3503GC.KeepAlive(this); 3514GC.KeepAlive(this); 3526GC.KeepAlive(this); 3538GC.KeepAlive(this); 3560GC.KeepAlive(module); 3691GC.KeepAlive(this); 3699GC.KeepAlive(this);
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (1)
51GC.KeepAlive(rt);
src\System\StubHelpers.cs (1)
1282GC.KeepAlive(m_obj);
src\System\Threading\Thread.CoreCLR.cs (5)
183GC.KeepAlive(this); 206GC.KeepAlive(this); 217GC.KeepAlive(this); 292GC.KeepAlive(this); 391GC.KeepAlive(this);
System.Private.DataContractSerialization (2)
System\Runtime\Serialization\CollectionDataContract.cs (2)
1598GC.SuppressFinalize(this); 1627GC.SuppressFinalize(this);
System.Private.Windows.Core (44)
System\DisposalTracking.cs (2)
23GC.SuppressFinalize(@object); 33/// Fires if <see cref="GC.SuppressFinalize(object)"/> is not called on the class and the class is finalized.
Windows\Win32\Foundation\HandleRef.cs (1)
15/// <see cref="GC.KeepAlive(object?)"/> on the <see cref="Wrapper"/> <see langword="object"/>.
Windows\Win32\Graphics\Gdi\BeginPaintScope.cs (1)
45GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\CreateBitmapScope.cs (1)
50GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\CreateBrushScope.cs (2)
52GC.SuppressFinalize(this); 63GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\CreateDcScope.cs (1)
67GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\CreatePenScope.cs (1)
45GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\HdcHandle.cs (2)
19GC.SuppressFinalize(hdc); 37GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\RegionScope.cs (1)
92GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\SelectObjectScope.cs (1)
53GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\SetBkModeScope.cs (1)
44GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\SetMapModeScope.cs (1)
45GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\SetRop2Scope.cs (1)
44GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\SetTextAlignmentScope.cs (1)
45GC.SuppressFinalize(this);
Windows\Win32\Graphics\Gdi\SetTextColorScope.cs (1)
45GC.SuppressFinalize(this);
Windows\Win32\PInvoke.CallWindowProc.cs (1)
18GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.GetWindowRect.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.GetWindowText.cs (1)
65GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.GetWindowTextLength.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.MapWindowPoints.cs (4)
18GC.KeepAlive(hWndFrom.Wrapper); 19GC.KeepAlive(hWndTo.Wrapper); 32GC.KeepAlive(hWndFrom.Wrapper); 33GC.KeepAlive(hWndTo.Wrapper);
Windows\Win32\PInvokeCore.BitBlt.cs (2)
30GC.KeepAlive(hdc.Wrapper); 56GC.KeepAlive(hdcSrc.Wrapper);
Windows\Win32\PInvokeCore.CopyImage.cs (2)
13GC.KeepAlive(hImage.Wrapper); 22GC.KeepAlive(hImage.Wrapper);
Windows\Win32\PInvokeCore.DrawIcon.cs (1)
16GC.KeepAlive(hIcon.Wrapper);
Windows\Win32\PInvokeCore.DrawIconEx.cs (1)
26GC.KeepAlive(hIcon.Wrapper);
Windows\Win32\PInvokeCore.EnumChildWindows.cs (1)
27GC.KeepAlive(hwndParent.Wrapper);
Windows\Win32\PInvokeCore.GetClientRect.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvokeCore.GetIconInfo.cs (1)
13GC.KeepAlive(icon.Wrapper);
Windows\Win32\PInvokeCore.GetWindowLong.cs (1)
33GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvokeCore.PeekMessage.cs (1)
18GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvokeCore.PostMessage.cs (1)
17GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvokeCore.SendMessage.cs (2)
16GC.KeepAlive(hWnd.Wrapper); 28GC.KeepAlive(wParam.Wrapper);
Windows\Win32\PInvokeCore.SetWindowLong.cs (3)
22GC.KeepAlive(hWnd.Wrapper); 31GC.KeepAlive(newValue.Wrapper); 40GC.KeepAlive(dwNewLong);
Windows\Win32\System\Com\AgileComPointer.cs (1)
134GC.SuppressFinalize(this);
System.Private.Windows.Core.Tests (3)
System\Value\MemoryWatch.cs (3)
79return new(GC.GetAllocatedBytesForCurrentThread()); 87Assert.Equal(0, GC.GetAllocatedBytesForCurrentThread() - _allocations); 90_allocations = GC.GetAllocatedBytesForCurrentThread();
System.Private.Windows.Core.TestUtilities (3)
FileCleanupTestBase.cs (1)
32GC.SuppressFinalize(this);
NoAssertContext.cs (1)
63GC.SuppressFinalize(this);
TempFile.cs (1)
70GC.SuppressFinalize(this);
System.Private.Windows.GdiPlus (10)
System\Drawing\IIconExtensions.cs (1)
29GC.KeepAlive(icon);
Windows\Win32\Graphics\GdiPlus\GpBitmapExtensions.cs (3)
28GC.KeepAlive(bitmap); 34GC.KeepAlive(bitmap); 47GC.KeepAlive(bitmap);
Windows\Win32\Graphics\GdiPlus\GpImageExtensions.cs (2)
19GC.KeepAlive(image); 29GC.KeepAlive(image);
Windows\Win32\Graphics\GdiPlus\GpMetafileExtensions.cs (1)
14GC.KeepAlive(metafile);
Windows\Win32\Graphics\GdiPlus\GpRegionExtensions.cs (3)
14GC.KeepAlive(region); 15GC.KeepAlive(graphics); 27GC.KeepAlive(region);
System.Private.Xml (2)
System\Xml\Core\XmlWriterAsync.cs (1)
581GC.SuppressFinalize(this);
System\Xml\Dom\XmlElementList.cs (1)
282GC.SuppressFinalize(this);
System.Reflection.Metadata (3)
System\Reflection\Internal\MemoryBlocks\AbstractMemoryBlock.cs (1)
38GC.KeepAlive(this);
System\Reflection\Internal\MemoryBlocks\MemoryBlockProvider.cs (1)
59GC.SuppressFinalize(this);
System\Reflection\Internal\Utilities\CriticalDisposableObject.cs (1)
14GC.SuppressFinalize(this);
System.Reflection.MetadataLoadContext (1)
System\Reflection\MetadataLoadContext.Apis.cs (1)
281GC.SuppressFinalize(this);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
208[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.GC))]
System.Runtime.Caching (10)
System\Runtime\Caching\CacheMemoryMonitor.cs (2)
48_gen2Count = GC.CollectionCount(2); 163int gen2Count = GC.CollectionCount(2);
System\Runtime\Caching\ChangeMonitor.cs (1)
102GC.SuppressFinalize(this);
System\Runtime\Caching\MemoryCache.cs (1)
467GC.SuppressFinalize(this);
System\Runtime\Caching\MemoryCacheStatistics.cs (2)
113int gen2Count = GC.CollectionCount(2); 207int gen2Count = GC.CollectionCount(2);
System\Runtime\Caching\PhysicalMemoryMonitor.Unix.cs (4)
31int ccount = GC.CollectionCount(0); 34GC.Collect(0, GCCollectionMode.Optimized); // A quick, ephemeral Gen 0 collection 35ccount = GC.CollectionCount(0); 40GCMemoryInfo memInfo = GC.GetGCMemoryInfo();
System.Runtime.InteropServices (5)
System\Runtime\InteropServices\HandleCollector.cs (4)
78(_gcCounts[collectionGeneration] == GC.CollectionCount(collectionGeneration)))) 80GC.Collect(collectionGeneration); 87_gcCounts[i] = GC.CollectionCount(i); 118_gcCounts[i] = GC.CollectionCount(i);
System\Runtime\InteropServices\Marshalling\ComObject.cs (1)
88GC.SuppressFinalize(this);
System.Security.Cryptography (27)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (1)
33GC.SuppressFinalize(newHandle);
System\Security\Cryptography\AsymmetricAlgorithm.cs (1)
79GC.SuppressFinalize(this);
System\Security\Cryptography\Base64Transforms.cs (2)
95GC.SuppressFinalize(this); 341GC.SuppressFinalize(this);
System\Security\Cryptography\BasicSymmetricCipher.cs (1)
40GC.SuppressFinalize(this);
System\Security\Cryptography\DeriveBytes.cs (1)
14GC.SuppressFinalize(this);
System\Security\Cryptography\HashAlgorithm.cs (1)
167GC.SuppressFinalize(this);
System\Security\Cryptography\HashProvider.cs (1)
69GC.SuppressFinalize(this);
System\Security\Cryptography\MD5.cs (1)
68byte[] buffer = GC.AllocateUninitializedArray<byte>(HashSizeInBytes);
System\Security\Cryptography\RandomNumberGenerator.cs (1)
28GC.SuppressFinalize(this);
System\Security\Cryptography\SHA1.cs (1)
65byte[] buffer = GC.AllocateUninitializedArray<byte>(HashSizeInBytes);
System\Security\Cryptography\SHA256.cs (1)
64byte[] buffer = GC.AllocateUninitializedArray<byte>(HashSizeInBytes);
System\Security\Cryptography\SHA384.cs (1)
64byte[] buffer = GC.AllocateUninitializedArray<byte>(HashSizeInBytes);
System\Security\Cryptography\SHA512.cs (1)
64byte[] buffer = GC.AllocateUninitializedArray<byte>(HashSizeInBytes);
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (1)
16_key = GC.AllocateArray<byte>(key.Length, pinned: true);
System\Security\Cryptography\SymmetricAlgorithm.cs (6)
188GC.SuppressFinalize(this); 473byte[] decryptBuffer = GC.AllocateUninitializedArray<byte>(ciphertext.Length); 592byte[] buffer = GC.AllocateUninitializedArray<byte>(ciphertextLength); 879byte[] buffer = GC.AllocateUninitializedArray<byte>(ciphertextLength); 1075byte[] decryptBuffer = GC.AllocateUninitializedArray<byte>(ciphertext.Length); 1315byte[] buffer = GC.AllocateUninitializedArray<byte>(ciphertextLength);
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
155byte[] buffer = GC.AllocateUninitializedArray<byte>(inputCount);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (1)
50byte[] buffer = GC.AllocateUninitializedArray<byte>(ciphertextLength);
System\Security\Cryptography\UniversalCryptoTransform.cs (1)
66GC.SuppressFinalize(this);
System\Security\Cryptography\X509Certificates\OpenSslExportProvider.cs (1)
68GC.KeepAlive(cert); // ensure cert's safe handle isn't finalized while raw handle is in use
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (1)
385byte[] certBytes = GC.AllocateUninitializedArray<byte>(fields.DecodedDataLength);
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
197GC.SuppressFinalize(this);
System.Security.Cryptography.Pkcs (1)
Internal\Cryptography\PkcsHelpers.cs (1)
229GC.KeepAlive(originalCert);
System.Threading (2)
System\Threading\Barrier.cs (1)
916GC.SuppressFinalize(this);
System\Threading\CountdownEvent.cs (1)
141GC.SuppressFinalize(this);
System.Threading.RateLimiting (5)
System\Threading\RateLimiting\PartitionedRateLimiter.T.cs (2)
96GC.SuppressFinalize(this); 120GC.SuppressFinalize(this);
System\Threading\RateLimiting\RateLimiter.cs (2)
100GC.SuppressFinalize(this); 124GC.SuppressFinalize(this);
System\Threading\RateLimiting\RateLimitLease.cs (1)
80GC.SuppressFinalize(this);
System.Threading.Tasks.Dataflow (2)
Base\DataflowBlock.cs (2)
436GC.SuppressFinalize(this); 522GC.SuppressFinalize(this);
System.Transactions.Local (1)
System\Transactions\InternalTransaction.cs (1)
416GC.SuppressFinalize(this);
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
536GC.Collect();
System.Windows.Forms (67)
System\Resources\ResXResourceReader.cs (1)
185GC.SuppressFinalize(this);
System\Resources\ResXResourceWriter.cs (1)
514GC.SuppressFinalize(this);
System\Windows\Forms\Accessibility\AccessibleObject.cs (1)
2772GC.KeepAlive(this);
System\Windows\Forms\ActiveX\AxHost.ConnectionPointCookie.cs (1)
85GC.SuppressFinalize(this);
System\Windows\Forms\ActiveX\AxHost.cs (1)
3219GC.KeepAlive(this);
System\Windows\Forms\ActiveX\AxHost.State.cs (1)
374GC.SuppressFinalize(this);
System\Windows\Forms\Application.cs (2)
1143GC.KeepAlive(handle); 1208GC.KeepAlive(handle);
System\Windows\Forms\Application.ThreadContext.cs (1)
345GC.SuppressFinalize(this);
System\Windows\Forms\ApplicationContext.cs (2)
36GC.SuppressFinalize(this); 94GC.SuppressFinalize(this);
System\Windows\Forms\Control.cs (2)
9285GC.KeepAlive(this); 12587GC.KeepAlive(this);
System\Windows\Forms\Control.FontHandleWrapper.cs (1)
36GC.SuppressFinalize(this);
System\Windows\Forms\Control.MetafileDCWrapper.cs (1)
79GC.SuppressFinalize(this);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
3231GC.KeepAlive(this); 3371GC.KeepAlive(this);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
5734GC.KeepAlive(this);
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (1)
763GC.SuppressFinalize(this);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1130GC.SuppressFinalize(this);
System\Windows\Forms\Controls\DataGridView\DataGridViewElement.cs (1)
33GC.SuppressFinalize(this);
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
1512GC.KeepAlive(this);
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (1)
79GC.SuppressFinalize(this);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
4915GC.KeepAlive(this); 5538GC.KeepAlive(callback);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1012GC.SuppressFinalize(this);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntryCollection.cs (1)
19GC.SuppressFinalize(this);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (2)
2918GC.KeepAlive(callback); 3018GC.KeepAlive(callback);
System\Windows\Forms\Controls\Splitter\Splitter.cs (1)
704GC.KeepAlive(ParentInternal);
System\Windows\Forms\Controls\TabControl\TabControl.cs (1)
1632GC.KeepAlive(toolTip);
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (1)
66GC.SuppressFinalize(this);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
3580GC.KeepAlive(ItemHdcInfo);
System\Windows\Forms\Controls\WebBrowser\HtmlHistory.cs (1)
33GC.SuppressFinalize(this);
System\Windows\Forms\Controls\WebBrowser\HtmlShim.cs (1)
80GC.SuppressFinalize(this);
System\Windows\Forms\DataBinding\Command.cs (1)
81GC.Collect();
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (1)
106GC.KeepAlive(Parent);
System\Windows\Forms\Design\PropertyTab.cs (1)
89GC.SuppressFinalize(this);
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (2)
238GC.KeepAlive(ownerWindowProcedure); 246GC.KeepAlive(ownerHwnd.Wrapper);
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (2)
518_charBuffer = GC.AllocateArray<char>(newBufferSize, pinned: true); 744_charBuffer = GC.AllocateArray<char>(FileBufferSize, pinned: true);
System\Windows\Forms\Form.cs (6)
2954GC.KeepAlive(this); 3436GC.KeepAlive(_ctlClient); 3665GC.KeepAlive(ownerHandle.Wrapper); 4913GC.KeepAlive(this); 5718GC.KeepAlive(ownerHwnd.Wrapper); 6030GC.KeepAlive(ownerHwnd);
System\Windows\Forms\Help\Help.cs (1)
218GC.KeepAlive(handle.Wrapper);
System\Windows\Forms\Input\Cursor.cs (4)
35GC.SuppressFinalize(this); 48GC.SuppressFinalize(this); 58GC.SuppressFinalize(this); 239GC.SuppressFinalize(this);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
1480GC.KeepAlive(this);
System\Windows\Forms\MDI\MDIClient.cs (1)
272GC.KeepAlive(child);
System\Windows\Forms\NativeWindow.cs (3)
326GC.ReRegisterForFinalize(this); 546GC.SuppressFinalize(this); 699GC.SuppressFinalize(this);
System\Windows\Forms\OLE\DragDropFormat.cs (1)
126GC.SuppressFinalize(this);
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
106GC.SuppressFinalize(paletteScope);
System\Windows\Forms\Rendering\PaintEventArgs.cs (1)
93GC.SuppressFinalize(this);
System\Windows\Forms\StringSource.cs (1)
53GC.KeepAlive(edit.Wrapper);
System\Windows\Forms\Timer.cs (1)
315GC.KeepAlive(this);
System\Windows\Forms\ToolTip\ToolTipBuffer.cs (1)
27_buffer = GC.AllocateUninitializedArray<char>(text.Length + 1, pinned: true);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
904GC.SuppressFinalize(this);
System\Windows\Forms\WindowSubclassHandler.cs (2)
134GC.SuppressFinalize(this); 158GC.KeepAlive(_windowProcDelegate);
System.Windows.Forms.Design (1)
System\ComponentModel\Design\ComponentDesigner.cs (1)
240GC.SuppressFinalize(this);
System.Windows.Forms.Primitives (88)
System\Windows\Forms\RefCountedCache.CacheEntry.cs (1)
87GC.SuppressFinalize(this);
System\Windows\Forms\RefCountedCache.cs (1)
190GC.SuppressFinalize(this);
Windows\Win32\PInvoke.ChildWindowFromPointEx.cs (1)
15GC.KeepAlive(hwndParent.Wrapper);
Windows\Win32\PInvoke.ClientToScreen.cs (1)
15GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.CloseHandle.cs (1)
12GC.KeepAlive(handle.Wrapper);
Windows\Win32\PInvoke.DestroyAcceleratorTable.cs (1)
13GC.KeepAlive(hAccel.Wrapper);
Windows\Win32\PInvoke.DragAcceptFiles.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.DrawMenuBar.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.EnableMenuItem.cs (1)
13GC.KeepAlive(hMenu.Wrapper);
Windows\Win32\PInvoke.EnableScrollBar.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.EnableWindow.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.EndDialog.cs (1)
13GC.KeepAlive(hDlg.Wrapper);
Windows\Win32\PInvoke.FillRect.cs (1)
13GC.KeepAlive(hDC.Wrapper);
Windows\Win32\PInvoke.GetAncestor.cs (1)
12GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.GetDlgItem.cs (1)
13GC.KeepAlive(hDlg.Wrapper);
Windows\Win32\PInvoke.GetDpiForWindow.cs (1)
14GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.GetMenu.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.GetMenuItemCount.cs (1)
13GC.KeepAlive(hMenu.Wrapper);
Windows\Win32\PInvoke.GetParent.cs (1)
12GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.GetScrollInfo.cs (1)
13GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.GetSystemMenu.cs (1)
12GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.GetTextExtentPoint32.cs (1)
16GC.KeepAlive(hdc.Wrapper);
Windows\Win32\PInvoke.GetThemeFont.cs (1)
17GC.KeepAlive(hTheme.Wrapper);
Windows\Win32\PInvoke.GetWindow.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.GetWindowThreadProcessId.cs (1)
15GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.HtmlHelp.cs (3)
15GC.KeepAlive(hwndCaller.Wrapper); 26GC.KeepAlive(hwndCaller.Wrapper); 43GC.KeepAlive(hwndCaller.Wrapper);
Windows\Win32\PInvoke.ImageList.cs (15)
16GC.KeepAlive(himl.Wrapper); 24GC.KeepAlive(himl.Wrapper); 33GC.KeepAlive(himl.Wrapper); 51GC.KeepAlive(himl.Wrapper); 52GC.KeepAlive(hdcDst.Wrapper); 63GC.KeepAlive(himl.Wrapper); 72GC.KeepAlive(himl.Wrapper); 80GC.KeepAlive(himl.Wrapper); 88GC.KeepAlive(himl.Wrapper); 96GC.KeepAlive(himl.Wrapper); 107GC.KeepAlive(himl.Wrapper); 108GC.KeepAlive(hicon.Wrapper); 116GC.KeepAlive(himl.Wrapper); 125GC.KeepAlive(himl.Wrapper); 137GC.KeepAlive(himl.Wrapper);
Windows\Win32\PInvoke.ImmGetContext.cs (1)
14GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.ImmReleaseContext.cs (1)
14GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.IntersectClipRect.cs (1)
12GC.KeepAlive(hdc.Wrapper);
Windows\Win32\PInvoke.InvalidateRect.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.InvalidateRgn.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.IsAccelerator.cs (1)
13GC.KeepAlive(hAccel.Wrapper);
Windows\Win32\PInvoke.IsChild.cs (2)
14GC.KeepAlive(hWndParent.Wrapper); 15GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.IsWindow.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.IsWindowEnabled.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.IsWindowVisible.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.KillTimer.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.NotifyWinEvent.cs (1)
13GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.RedrawWindow.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.RegisterDragDrop.cs (1)
22GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.RevokeDragDrop.cs (1)
12GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.ScreenToClient.cs (1)
15GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.ScrollWindow.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.ScrollWindowEx.cs (1)
20GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SendMessageCallback.cs (1)
21GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetActiveWindow.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetCapture.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetFocus.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetForegroundWindow.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetLayeredWindowAttributes.cs (1)
13GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.SetMenu.cs (3)
13GC.KeepAlive(hWnd.Wrapper); 23GC.KeepAlive(hWnd.Wrapper); 24GC.KeepAlive(hMenu.Wrapper);
Windows\Win32\PInvoke.SetParent.cs (2)
14GC.KeepAlive(hWndChild.Wrapper); 15GC.KeepAlive(hWndNewParent.Wrapper);
Windows\Win32\PInvoke.SetScrollInfo.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetScrollPos.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetTimer.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SetWindowPos.cs (2)
14GC.KeepAlive(hWnd.Wrapper); 15GC.KeepAlive(hWndInsertAfter.Wrapper);
Windows\Win32\PInvoke.SetWindowRgn.cs (1)
13GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.SetWindowText.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.SHAutoComplete.cs (1)
12GC.KeepAlive(hwndEdit.Wrapper);
Windows\Win32\PInvoke.ShowWindow.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.UiaHostProviderFromHwnd.cs (1)
15GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.UiaReturnRawElementProvider.cs (1)
20GC.KeepAlive(hwnd.Wrapper);
Windows\Win32\PInvoke.UpdateWindow.cs (1)
12GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\PInvoke.ValidateRect.cs (1)
13GC.KeepAlive(hWnd.Wrapper);
Windows\Win32\System\Com\StandardDispatch.cs (1)
298GC.SuppressFinalize(this);
Windows\Win32\UI\Controls\ToolInfoWrapper.cs (1)
48GC.KeepAlive(_handle);
System.Windows.Forms.Primitives.TestUtilities (2)
Metafiles\EmfScope.cs (1)
256GC.SuppressFinalize(this);
Win32\Window.cs (1)
49GC.SuppressFinalize(this);
System.Windows.Forms.Tests (27)
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (4)
1611GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true); 1631GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true);
System\Windows\Forms\Application.ParkingWindowTests.cs (2)
23GC.Collect(); 25GC.WaitForPendingFinalizers();
System\Windows\Forms\ControlTests.Internals.cs (2)
407GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true);
System\Windows\Forms\LayoutEventArgsTests.cs (2)
49GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true);
System\Windows\Forms\ListViewTests.cs (3)
1112GC.Collect(); // mark for finalization (also would clear normal weak references) 1113GC.WaitForPendingFinalizers(); // wait until finalizer is executed 1114GC.Collect(); // wait for long weak reference to be cleared
System\Windows\Forms\PropertyGridTests.cs (2)
3900GC.Collect(); 3901GC.WaitForPendingFinalizers();
System\Windows\Forms\PropertyStoreTests.cs (4)
163long currentBytes = GC.GetAllocatedBytesForCurrentThread(); 165currentBytes = GC.GetAllocatedBytesForCurrentThread() - currentBytes; 198long currentBytes = GC.GetAllocatedBytesForCurrentThread(); 200currentBytes = GC.GetAllocatedBytesForCurrentThread() - currentBytes;
System\Windows\Forms\ToolStripTests.cs (8)
7325GC.Collect(); 7326GC.WaitForPendingFinalizers(); 7327GC.Collect(); 7328GC.WaitForPendingFinalizers(); 7359GC.Collect(); 7360GC.WaitForPendingFinalizers(); 7361GC.Collect(); 7362GC.WaitForPendingFinalizers();
System.Windows.Forms.UI.IntegrationTests (1)
ImageListTests.cs (1)
72GC.GetTotalMemory(true);
System.Xaml (5)
System\Xaml\NameScope.cs (1)
263public void Dispose() => GC.SuppressFinalize(this);
System\Xaml\NameScopeDictionary.cs (1)
156GC.SuppressFinalize(this);
System\Xaml\Parser\NodeStreamSorter.cs (1)
159GC.SuppressFinalize(this);
System\Xaml\XamlReader.cs (1)
54GC.SuppressFinalize(this);
System\Xaml\XamlWriter.cs (1)
73GC.SuppressFinalize(this);
UIAutomationClient (7)
MS\Internal\Automation\UiaCoreApi.cs (7)
367GC.KeepAlive(request._condition); // keep condition (and associated unmanaged memory) alive during call 379GC.KeepAlive(request._condition); // keep condition (and associated unmanaged memory) alive during call 391GC.KeepAlive(request._condition); // keep condition (and associated unmanaged memory) alive during call 433GC.KeepAlive(request._condition); // keep condition (and associated unmanaged memory) alive during call 450GC.KeepAlive(request._condition); // keep condition (and associated unmanaged memory) alive during call 451GC.KeepAlive(findCondition); 591GC.KeepAlive(request._condition); // keep condition (and associated unmanaged memory) alive during call
UIAutomationTypes (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
120GC.Collect();
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (1)
2014GC.SuppressFinalize(this);
vbc (1)
src\Compilers\Shared\BuildClient.cs (1)
333GC.SuppressFinalize(npcs);
VBCSCompiler (2)
src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (1)
233GC.GetTotalMemory(forceFullCollection: true);
src\Compilers\Shared\BuildClient.cs (1)
333GC.SuppressFinalize(npcs);
VBCSCompiler.UnitTests (2)
CompilerServerTests.cs (2)
845GC.KeepAlive(rootDirectory); 959GC.KeepAlive(rootDirectory);
Wasm.Performance.TestApp (1)
WasmMemory.cs (1)
11public static long GetTotalMemory() => GC.GetTotalMemory(forceFullCollection: true);
WinFormsControlsTest (7)
FormOwnerTestForm.cs (6)
26long memoryStart = GC.GetTotalMemory(false); 40long memoryBeforeGC = GC.GetTotalMemory(false); 41GC.Collect(); 42GC.WaitForPendingFinalizers(); 43GC.Collect(); 44long memoryAfterGC = GC.GetTotalMemory(true);
ScalingBeforeChanges.cs (1)
52GC.KeepAlive(this);