2008
04.07

Apparently there is no way I haven’t find a way to determine the size of a .NET managed object in memory.

The closest I can come out, particularly for a DataSet object is as follows:

DataSet ds = new DataSet();
// ...
// This is where you populate the content of DataSet
// ...
String xmlContent = ds.GetXml();
UnicodeEncoding uniEnc = new UnicodeEncoding();
int byteCount = uniEnc.GetByteCount(xmlContent);

But why we use UnicodeEncoding, not ASCIIEncoding, or UTF8Encoding, well, as MSDN says, String object is a collection of Unicode characters. So if we want to know how many bytes are they, we need to use UnicodeEncoding.

Of course we are still far from our actual objective, but this is a good start. I’ll update as I found other possible method.

 

Possibly Related Posts

 

Incoming Search Term

how to check dataset size (3), calculating size of dataset in vb net (1), net find size of object (1), how to find the size of net object (1), how to find the size of a dataset (1), how to find the length of dataset in vb net (1), how to find dataset size (1), how to determine size of dataset (1), how to decide the size of a dataset in vb (1), how to compute the size of a dataset (1), how know size dataset (1), get length of dataset for post vb net (1), determining size of dataset (1), determine the size of dataset (1), determine size of dataset (1), determine dataset size (1), dataset determine size (1), vb net how to calculate size of object (1)

Advertise Here

1 Trackback

 

1 comment so far

Add Your Comment
  1. Hmm.. to think about it… Serialization could do the trick…. :D

* Copy this password:

* Type or paste password here: