Determine how much memory a class uses?-Collection of common programming errors

I agree that a memory profiler is the easiest way to get the information you are looking for. In addition to the two previously mentioned, I recommend JetBrains dotTrace, which is both a performance profiler and a memory profiler.

If you want to do it yourself, and are willing to get pretty deep into the guts of the CLR, you can use the .NET Profiling API, which is an unmanaged API that (as Microsoft says): “enables a profiler to monitor a program’s execution by the common language runtime (CLR).” It’s not exactly intended for casual use, but it does have an enormous amount of functionality.