Re: How do I measure the size of a dataset?



Hi Jialiang,

I am developing a web application and I have to put this dataset in asp.net in-memory session.
I am concern about the web server memory that this dataset might occupy.

The memory that a dataset occupies might not be equal with the size of the dataset's serialization result (am I wrong?)

Is there any technique to analyze the amt of RAM memory that a dataset occupies?

Thank you,
Max



""Jialiang Ge [MSFT]"" <jialge@xxxxxxxxxxxxxxxxxxxx> wrote in message news:yVHGrzS8IHA.4744@xxxxxxxxxxxxxxxxxxxxxxxxx
Hello Max,

I assume that you meant the size of the dataset's serialization result by
"the size of a dataset (including data in the data tables and rows). The
answer depends on the serialization format:

If we use BinaryFormatter, Code list 1 shows the pseudocode:

---Code list 1 ---
DataSet ds = GetData();
ds.RemotingFormat = SerializationFormat.Binary;
BinaryFormatter bin = new BinaryFormatter();
bin.Serialize(stream, ds);
Console.Write(stream.Length);

If we serialize the dataset to XML, we can do it in this way:

---Code list 2 ---
DataSet ds = GetData();
Console.Write(Encoding.UTF8.GetByteCount(ds.GetXml()));

For more information of DataSet Serialization, please refer to the articles:

Binary Serialization of DataSets
http://msdn.microsoft.com/en-us/magazine/cc163911.aspx

Improving DataSet Serialization and Remoting Performance
http://support.microsoft.com/kb/829740/en-us

If you have any other questions or concerns, please DON'T hesitate to tell
me.

Regards,
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Mapping memory of another process
    ... we can map the physical memory to the current process virtual space ... Let's say this remote thread loads an injected dll in that ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Memory Cleanup
    ... NET CLR will check if the memoery is low and garbage collection needs to ... If you really need the memory of an object to be released at once, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Trouble of GDI+ generic error!
    ... I got this error while printing something to printer in WinForm ... memory status. ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Trouble of GDI+ generic error!
    ... As for the "A Generic error occured in GDI+", it does be a very generic ... For memory specific issue, a commom diagnostic means is using the ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ADO.NET dataset limit
    ... the memory couldn't hold it what errors would be encountered? ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.dotnet.languages.vb)

Quantcast