How to get Object size in memory  
Author Message
Nonlip





PostPosted: Visual C# General, How to get Object size in memory Top

There is cache(a queue object) in my application.now,I want to know how much space in memory is being taken up by that object at runtime.

Marshal.SizeOf(...) Is it realy size of object in memory



Visual C#14  
 
 
Peter Ritchie





PostPosted: Visual C# General, How to get Object size in memory Top

No, Marshal.Sizeof() is the amount of memory required to marshal an object to/from native code. The size of any given object is undefined and cannot truly be determined in .NET. outside of a de****. http://www.hide-link.com/ has a thread discussing similar.