473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

LOH behavior

As I understand it, the .NET framework places objects on the Large
Objects Heap (LOH) if they are over 85kb in size.

So for an object like

public class MyClass
{
private byte[] largeArray = new byte[100000];
}

the MyClass object will go to the regular managed heap, while largeArray
object will end up on the LOH. This suggests that it is really
difficult to know which pieces of a real life object will go to LOH,
since the Parent does not necessarily go to LOH.

With this in mind, if I load a DataSet that that contains 100MB of data,
what exactly (if anything) goes to LOH?
Also, how can I see this LOH allocation using the CLR Profiler.
Regards
Jan 10 '07 #1
7 3213
Peter Bromberg [C# MVP] wrote:
What on earth are you doing with a 100MB DataSet! Yikes!
Massive processing of data. It turns out that processing in c# for this
type of data (it does not lend itself to set processing very well), is
on the order of 50 times faster than in SQL.

Regards
Jan 10 '07 #2
Hi,

"Frank Rizzo" <no**@none.comwrote in message
news:On**************@TK2MSFTNGP04.phx.gbl...
>
With this in mind, if I load a DataSet that that contains 100MB of data,
what exactly (if anything) goes to LOH?
First of all, with this amount of data you will have A LOT more to worry
about that the memory, parsing it will be a killer!!!

That amount of data belongs to a database, not a dataset.

Answering your question though, most probably NOTHING from the data will go
to the LOH, you did not especified your DB though.
The most probably residend of the LOH will the arrays that the dataset
should have internally. But your data most probably will not be there.
In short, use a DB
--
Ignacio Machin
machin AT laceupsolutions com
Jan 10 '07 #3
Frank Rizzo <no**@none.comwrote:
As I understand it, the .NET framework places objects on the Large
Objects Heap (LOH) if they are over 85kb in size.

So for an object like

public class MyClass
{
private byte[] largeArray = new byte[100000];
}

the MyClass object will go to the regular managed heap, while largeArray
object will end up on the LOH. This suggests that it is really
difficult to know which pieces of a real life object will go to LOH,
since the Parent does not necessarily go to LOH.

With this in mind, if I load a DataSet that that contains 100MB of data,
what exactly (if anything) goes to LOH?
Probably nothing. The only things that will end up on the LOH are
objects where the *individual object* is over 85K. In real life, that's
likely to only be huge arrays (like the one above) and long strings.
For reference types, arrays would have to have ~21,000 elements to end
up on the LOH (assuming you're running in a 32-bit CLR) - so if you've
got about that many rows, chances are that array (assuming it's backed
by an array - it's pretty likely) will be on the LOH, but not the rows
themselves.
Also, how can I see this LOH allocation using the CLR Profiler.
Couldn't tell you that, I'm afraid - it's a while since I've used it.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 10 '07 #4
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

"Frank Rizzo" <no**@none.comwrote in message
news:On**************@TK2MSFTNGP04.phx.gbl...
>With this in mind, if I load a DataSet that that contains 100MB of data,
what exactly (if anything) goes to LOH?

First of all, with this amount of data you will have A LOT more to worry
about that the memory, parsing it will be a killer!!!
Actually, it takes about 20 seconds to bring the data into the client
and 4 seconds to build an object tree. And this is on my 2 year old
laptop. The app will be on a powerful server.
That amount of data belongs to a database, not a dataset.
In short, use a DB
In general, yes, however, for the data that does not lend itself to set
processing, c# is way better.
Jan 10 '07 #5
Hi Frank,

Since the DataSet has a lot of reference to small pieces of data, I agree
that nearly nothing will be put into LOH, unless you have large strings or
arrays inside the DataSet itself.

To check the Large Object Heap size, you will see it in the statistics
window. I'm currently using the v2.0 of CLR profiler. You can see it on
page 10 of the help document.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.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/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jan 11 '07 #6
Hi,,

"Frank Rizzo" <no**@none.comwrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
| Ignacio Machin ( .NET/ C# MVP ) wrote:
| Hi,
| >
| "Frank Rizzo" <no**@none.comwrote in message
| news:On**************@TK2MSFTNGP04.phx.gbl...
| >With this in mind, if I load a DataSet that that contains 100MB of
data,
| >what exactly (if anything) goes to LOH?
| >
| First of all, with this amount of data you will have A LOT more to worry
| about that the memory, parsing it will be a killer!!!
|
| Actually, it takes about 20 seconds to bring the data into the client
| and 4 seconds to build an object tree. And this is on my 2 year old
| laptop. The app will be on a powerful server.

4 s for a 100MB dataset?

I have problems when the dataset goes over 10MB , it takes like 30 s to
load it.
--
Ignacio Machin
machin AT laceupsolutions com
Jan 11 '07 #7
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,,

"Frank Rizzo" <no**@none.comwrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
| Ignacio Machin ( .NET/ C# MVP ) wrote:
| Hi,
| >
| "Frank Rizzo" <no**@none.comwrote in message
| news:On**************@TK2MSFTNGP04.phx.gbl...
| >With this in mind, if I load a DataSet that that contains 100MB of
data,
| >what exactly (if anything) goes to LOH?
| >
| First of all, with this amount of data you will have A LOT more to worry
| about that the memory, parsing it will be a killer!!!
|
| Actually, it takes about 20 seconds to bring the data into the client
| and 4 seconds to build an object tree. And this is on my 2 year old
| laptop. The app will be on a powerful server.

4 s for a 100MB dataset?

I have problems when the dataset goes over 10MB , it takes like 30 s to
load it.
They the price of creating/adding a new object is too high. Make sure
that the constructor does nothing but simply populate properties.
My dataset is divided into several tables which all bring related
information. Do not use the related tables feature because it simply
slows the living hell out of the process. Besides, it is kind of
useless, since all the data in the dataset must be loaded into the
object tree. So I simply loop through each table and use hashtables
(created on the fly) to keep track of related information in DataTable
objects.
>
Jan 12 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Dave Rahardja | last post by:
Does the C++ standard specify the behavior of floating point numbers during "exceptional" (exceptional with respect to floating point numbers, not exceptions) conditions? For example: double...
19
by: E. Robert Tisdale | last post by:
In the context of the comp.lang.c newsgroup, the term "undefined behavior" actually refers to behavior not defined by the ANSI/ISO C 9 standard. Specifically, it is *not* true that "anything can...
23
by: Ken Turkowski | last post by:
The construct (void*)(((long)ptr + 3) & ~3) worked well until now to enforce alignment of the pointer to long boundaries. However, now VC++ warns about it, undoubtedly to help things work on 64...
38
by: Steven Bethard | last post by:
> >>> aList = > >>> it = iter(aList) > >>> zip(it, it) > > That behavior is currently an accident. >http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1121416
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
66
by: gyan | last post by:
Hi All, I am using sprintf and getting starnge output in following case char temp_rn; memset(temp_rn,'\0',12); sprintf(temp_rn,"0%s",temp_rn); the final value in temp_rn is 00 how it...
12
by: Rajesh S R | last post by:
Can anyone tell me what is the difference between undefined behavior and unspecified behavior? Though I've read what is given about them, in ISO standards, I'm still not able to get the...
28
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
35
by: bukzor | last post by:
I've found some bizzare behavior when using mutable values (lists, dicts, etc) as the default argument of a function. I want to get the community's feedback on this. It's easiest to explain with...
33
by: coolguyaroundyou | last post by:
Will the following statement invoke undefined behavior : a^=b,b^=a,a^=b ; given that a and b are of int-type ?? Be cautious, I have not written a^=b^=a^=b ; which, of course, is undefined....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.