views:

119

answers:

3

I would like to be able to know, in run-time in my code, how much memory a certain object is taking (a Dataset in this case, but i'm looking for a "general" solution).

Is this possible through reflection?

This is for .Net 2.0.

Thanks!

A: 

Great, so to sumarize, there is no easy way, other than using the Profiling API which is a lot of work. Thanks!

Daniel Magliola
A: 
int size = Marshal.SizeOf(typeof(int));

That should work too.

justin.m.chase
Not for an object, only for a struct.
Jon B