473,471 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filling DataSet causes System OutOfMemory exception


I am pulling some data from a source via ODBC and placing the information
in a DataSet. The first pull is very large but once that is complete I plan
to do nightly pulls to get any new data that gets put in the (remote) table.

I can't seem to get past that initial (big) pull of data, as I get OutOfMemory
exceptions. I took a look back at when this occurs and it seems to happen upon
stuffing the DataSet with either the 2097153 record or the 4194305 record.
My question is, is there a physical limitation to a Dataset as these numbers
are fairly consistent numbers? BTW, I have upgraded the server to have 4GB
of memory and have two swap files with 4MB's each. I suspect this would be
enough memory? Perhaps the swap files aren't in play/use when appending
data to a DataSet?

So the key question is if I can do anything to allow the DataSet to store more
memory? I have probably done as much as I can to give as much memory to the
OS. (I am using V2.0.50727.42 of .NET)....
Jul 29 '06 #1
2 7855
Peter S. wrote:
I am pulling some data from a source via ODBC and placing the
information
in a DataSet. The first pull is very large but once that is complete
I plan to do nightly pulls to get any new data that gets put in the
(remote) table.

I can't seem to get past that initial (big) pull of data, as I get
OutOfMemory exceptions. I took a look back at when this occurs and it
seems to happen upon stuffing the DataSet with either the 2097153
record or the 4194305 record.
My question is, is there a physical limitation to a Dataset as these
numbers are fairly consistent numbers? BTW, I have upgraded the
server to have 4GB
of memory and have two swap files with 4MB's each. I suspect this
would be enough memory? Perhaps the swap files aren't in play/use
when appending
data to a DataSet?

So the key question is if I can do anything to allow the DataSet to
store more memory? I have probably done as much as I can to give as
much memory to the OS. (I am using V2.0.50727.42 of .NET)....
AFIAK, there's no specific limit to DataSet per-se - you're likely facing
the overall limit of the 2Gb user address space available to programs under
Windows.

A couple of things that should help:

1. Change the boot.ini of the server to include the /3Gb switch and mark
your executable as Large Address Aware. This decreases the amount of memory
available to the kernel, so you might not want to leave it like this, but it
could get you past this first hurdle.

2. Move to a 64-bit machine.

3. Change your design to pull the data over in smaller chunks.

-cd
Jul 29 '06 #2
Excellent suggestions, thanks! My latest tack is to bail out when I get
the OutOfmemory exception and squirrel away what I got up to that
point. However I certainly want to minimize this and will try your
suggestions!

Thanks!

"Carl Daniel [VC++ MVP]" wrote:
Peter S. wrote:
I am pulling some data from a source via ODBC and placing the
information
in a DataSet. The first pull is very large but once that is complete
I plan to do nightly pulls to get any new data that gets put in the
(remote) table.

I can't seem to get past that initial (big) pull of data, as I get
OutOfMemory exceptions. I took a look back at when this occurs and it
seems to happen upon stuffing the DataSet with either the 2097153
record or the 4194305 record.
My question is, is there a physical limitation to a Dataset as these
numbers are fairly consistent numbers? BTW, I have upgraded the
server to have 4GB
of memory and have two swap files with 4MB's each. I suspect this
would be enough memory? Perhaps the swap files aren't in play/use
when appending
data to a DataSet?

So the key question is if I can do anything to allow the DataSet to
store more memory? I have probably done as much as I can to give as
much memory to the OS. (I am using V2.0.50727.42 of .NET)....

AFIAK, there's no specific limit to DataSet per-se - you're likely facing
the overall limit of the 2Gb user address space available to programs under
Windows.

A couple of things that should help:

1. Change the boot.ini of the server to include the /3Gb switch and mark
your executable as Large Address Aware. This decreases the amount of memory
available to the kernel, so you might not want to leave it like this, but it
could get you past this first hurdle.

2. Move to a 64-bit machine.

3. Change your design to pull the data over in smaller chunks.

-cd
Jul 29 '06 #3

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

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
3
by: Mike Schilling | last post by:
Instances of SystemOutOfMemoryException do not contain a stack trace. Easy test to verify this: class OOM { public static void Main() { try { Object arr = new Object; } catch...
2
by: J | last post by:
I'm experimenting with strongly typed datasets, and when the .Fill method is called, the RowChanging fires for each row. This causes a problem when the existing data does not adhere to the rules...
1
by: Krzysztof Karnicki | last post by:
I have such a problem… I have create my custom DataGridColumn inheriting from System.Windows.Forms.DataGridColumnStyle on using it on DataGrid, to show rows painted by me self. Because dates ...
1
by: Tobias Matzat | last post by:
Hello! I'm writing an application that immitates ie behavior to save html-pages. Well fecht the files in the webpage and change the paths in the href/src attributes. Well, I#m doing this with...
14
by: Elena | last post by:
I am trying to fill a DataSet using the code at the bottom of this message. At the Fill line, I get an error: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in...
4
by: gillcleeren | last post by:
I have a datagrid that has to be filled in a WinForms application. The data comes from an Oracle database. The normal procedure would be filling a dataset, but I have the problem that there are...
0
by: Derek Vincent | last post by:
Why am I having problems filling my dataset when I select fields of type varchar(350) from interbase? I can fill the dataset when I select every other field in the table but I receive and error...
3
by: JJA | last post by:
I am confused about all the various methods of handling XML in ASP.Net 2.0. I want to be able to stream XML to some clientside Javascript code (snippet below): var urlRequest =...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.