Hi Tobe,
That's not really that easy to do without actually tracing the individual
objects. For example, if an object has a string field, that could point to a
large string or a small string or even to a null string. Thing is, if those
strings are interned, then there could be other objects referencing the same
string. So without do a complete memory trace you can't accurately gauge
this.
Probably the best rough guide you will get is from trying to serialize the
object, or in this case as the dataset is a MarshalByValueComponent, you
could try get the length of the xml.
An alternative is to let the GC maybe take control of this and use weak
references and provide your own automatic resurrection as needed.
Or, one other approach would be just to get the count of row x columns *
column size using an approximation for the length of strings in string
columns.
Quote:
> How can I tell the size of an object in VB? I have a
> dataset that I am filling with schema info and I want to
> find out how much memory it is taking to see if it is
> worth it to keep it in memory.