c#中类实例的内存使用情况

可能重复:
C#/ .NET对象使用多少内存?

就像标题所说的那样,如何在c#(webforms)中检查类实例占用内存的内存量

private System.Diagnostics.PerformanceCounter ramCounter; ramCounter = new System.Diagnostics.PerformanceCounter("Memory", "Available MBytes"); public string getAvailableRAM() { return ramCounter.NextValue() + "Mb"; } 

这些是您可以使用的工具:D希望有所帮助。

你可以检查一下 – 在c#中查找对象实例的大小(以字节为单位)