From 77aa3701b14b8f48541ece40fb8f4bba2bf87417 Mon Sep 17 00:00:00 2001 From: Alex Meseldzija Date: Fri, 30 May 2025 11:39:34 +0200 Subject: [PATCH] update RSPEC --- rules/S1215/csharp/rule.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rules/S1215/csharp/rule.adoc b/rules/S1215/csharp/rule.adoc index 4e749a942db..1ef143f5b63 100644 --- a/rules/S1215/csharp/rule.adoc +++ b/rules/S1215/csharp/rule.adoc @@ -20,12 +20,15 @@ static void Main(string[] args) There may be exceptions to this rule: for example, you've just triggered some event that is unique in the run of your program that caused a lot of long-lived objects to die, and you want to release their memory. +This rule also raises on `GC.GetTotalMemory` when `forceFullCollection` is true as it directly invokes `GC.Collect`. + == Resources === Documentation * https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/[Garbage collection] * https://learn.microsoft.com/en-us/dotnet/api/system.gc.collect[GC.Collect] +* https://learn.microsoft.com/en-us/dotnet/api/system.gc.gettotalmemory[GC.GetTotalMemory] * https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/latency[Garbage collection latency modes] * https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/performance#troubleshoot-performance-issues[Garbage collection troubleshoot performance issues]