Object Size in memory

  • Thread starter Thread starter SStory
  • Start date Start date
S

SStory

How can I find the size of an object in memory?

Say a bitmap?

I took a bitmap and resized it and am storing in memory.
Would like to be able to see the amount of memory that object is taking.

How to???

Shane
 
So there is no SIZEOF like in C++? or anything similar to get memory size
internally?

Thanks,

Shane
 
Try this code
int i = 0;

Console.WriteLine("Int size: {0}", Marshal.SizeOf(i.GetType()));

HTH

Alex
 
It tells me that it can't do it. Something about no intellegent unmanaged
size can be calculated---this is a paraphrase of course.

Shane
 
Back
Top