https://learn.microsoft.com/en-us/dotnet/api/system.gc.getallocatedbytesforcurrentthread?view=netframework-4.8.1&viewFallbackFrom=net-6.0
GC.GetAllocatedBytesForCurrentThread Method (System) | Microsoft Learn
Gets the total number of bytes allocated to the current thread since the beginning of its lifetime.
gcmethodsystemmicrosoftlearn