类实例的内存使用在c#

类实例的内存使用在c#

本文介绍了类实例的内存使用在c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



$ b b

如标题所示,我如何检查一个类实例在c#(webforms)中记忆的内存量。

解决方案
  private System.Diagnostics.PerformanceCounter ramCounter; 
ramCounter = new System.Diagnostics.PerformanceCounter(Memory,Available MBytes);

public string getAvailableRAM()
{
return ramCounter.NextValue()+Mb;
}

这些是你的处置工具:D希望有帮助。 >

Like the title says, how can I check how much memory a class instance takes in memory in c# (webforms)

解决方案
private System.Diagnostics.PerformanceCounter ramCounter;
ramCounter = new System.Diagnostics.PerformanceCounter("Memory", "Available MBytes");

public string getAvailableRAM()
{
      return ramCounter.NextValue() + "Mb";
}

Those be the tools to your disposal :D hopefully that helps.

这篇关于类实例的内存使用在c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:50