在异步线程的整个生命周期中,GC.GetAllocatedBytesForCurrentThread的行为如何?

时间:2019-05-22 10:05:59

标签: c# .net-core benchmarking

我不确定,不确定如何测试:

这是否可以准确反映线程在整个生命周期内的内存使用情况?

在线程生命周期中是否需要其他考虑来获得准确的值,例如在线程中等待另一个任务完成时?

MSDN几乎没有有关预期行为的信息:https://docs.microsoft.com/en-us/dotnet/api/system.gc.getallocatedbytesforcurrentthread?view=netframework-4.8

0 个答案:

没有答案