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

FerranB picture FerranB · Jan 9, 2009 · Viewed 49.7k times · Source

I'm developing an application which currently have hundreds of objects created.

Is it possible to determine (or approximate) the memory allocated by an object (class instance)?

Answer

Rauhotz picture Rauhotz · Jan 9, 2009

You could use a memory profiler like

.NET Memory Profiler (http://memprofiler.com/)

or

CLR Profiler (free) (http://clrprofiler.codeplex.com/)