Re: How do I measure the size of a dataset?
- From: "Max2006" <alanalan1@xxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jul 2008 10:55:46 -0400
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.
- Follow-Ups:
- Re: How do I measure the size of a dataset?
- From: "Jialiang Ge [MSFT]"
- Re: How do I measure the size of a dataset?
- References:
- How do I measure the size of a dataset?
- From: Max2006
- RE: How do I measure the size of a dataset?
- From: "Jialiang Ge [MSFT]"
- How do I measure the size of a dataset?
- Prev by Date: Re: How do I measure the size of a dataset?
- Next by Date: Re: Any Option to Save Changes to Database?
- Previous by thread: RE: How do I measure the size of a dataset?
- Next by thread: Re: How do I measure the size of a dataset?
- Index(es):
Relevant Pages
|