3

Possible Duplicate:
How much memory does a C#/.NET object use?

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

4
  • 2
    Why do you need to know? Commented Jan 20, 2011 at 20:55
  • I wonder what practical application this might have. Commented Jan 20, 2011 at 20:56
  • 2
    Who cares if it has a practical application or not. It's an interesting question. Unfortunately, a duplicate. :) Commented Jan 20, 2011 at 21:00
  • Thank you siz! So annoying when people do that. Ruins this site. Commented Jan 20, 2011 at 21:02

2 Answers 2

4

You can check this one - Find size of object instance in bytes in c#

Sign up to request clarification or add additional context in comments.

Comments

2
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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.