PC Review


Reply
Thread Tools Rate Thread

running out of memory

 
 
=?Utf-8?B?U3VwZXJ0cmVl?=
Guest
Posts: n/a
 
      6th Apr 2005
Hi;

I have to write custom data integrity utilities comparing files with table
data.
I've found that looping through an ado recordset will cause memory problems
if it's a large recordset.

I'm using this sort of syntax:

adoRSdir = adocn.Execute(sSQL, lrecs)

Do Until adoRSdir.EOF = True
'this loop is running out of memory
Loop

How can you monitor if you're going to run out of memory?
What technique would be better other than narrowing the sql
querystring result set?

Thanks for your knowledge.

Best Regards;

Todd

 
Reply With Quote
 
 
 
 
Val Mazur \(MVP\)
Guest
Posts: n/a
 
      7th Apr 2005
Hi,

First of all it is not ADO, but ADO.NET newsgroup. Maybe you should consider
using of the SQL statements on a server side inside of SP to do this rather
than looping through the records. What do you need to achieve?

--
Val Mazur
Microsoft MVP

http://xport.mvps.org



"Supertree" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi;
>
> I have to write custom data integrity utilities comparing files with table
> data.
> I've found that looping through an ado recordset will cause memory
> problems
> if it's a large recordset.
>
> I'm using this sort of syntax:
>
> adoRSdir = adocn.Execute(sSQL, lrecs)
>
> Do Until adoRSdir.EOF = True
> 'this loop is running out of memory
> Loop
>
> How can you monitor if you're going to run out of memory?
> What technique would be better other than narrowing the sql
> querystring result set?
>
> Thanks for your knowledge.
>
> Best Regards;
>
> Todd
>



 
Reply With Quote
 
 
 
 
Alex Passos
Guest
Posts: n/a
 
      7th Apr 2005
Hi, take a look at this article it discusses some code optimization
strategies:

http://www.vbip.com/books/1861002610...er_2610_07.asp

And if you are using SQL Server you can also limit your query with something
like

SELECT TOP 100 ....

And then change your condition such as greater than the value of the 100th
row for the next query.
Make sure that from iteration to iteration you are closing the recordset and
releasing its memory by setting it to null when the iteration completes.

Alex

"Supertree" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi;
>
> I have to write custom data integrity utilities comparing files with table
> data.
> I've found that looping through an ado recordset will cause memory
> problems
> if it's a large recordset.
>
> I'm using this sort of syntax:
>
> adoRSdir = adocn.Execute(sSQL, lrecs)
>
> Do Until adoRSdir.EOF = True
> 'this loop is running out of memory
> Loop
>
> How can you monitor if you're going to run out of memory?
> What technique would be better other than narrowing the sql
> querystring result set?
>
> Thanks for your knowledge.
>
> Best Regards;
>
> Todd
>



 
Reply With Quote
 
=?Utf-8?B?U3VwZXJ0cmVl?=
Guest
Posts: n/a
 
      7th Apr 2005
This suggestion from Stephen Howe worked.

If same machine:
Same thing applies but now you are aware that your SQL request may cause
your database considerable overhead depending on complexity of request. I
would be tempted to do

adoRSdir.Open(SQLRequest,,,,) etc

Thanks for your responses:

"Val Mazur (MVP)" wrote:

> Hi,
>
> First of all it is not ADO, but ADO.NET newsgroup. Maybe you should consider
> using of the SQL statements on a server side inside of SP to do this rather
> than looping through the records. What do you need to achieve?
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "Supertree" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi;
> >
> > I have to write custom data integrity utilities comparing files with table
> > data.
> > I've found that looping through an ado recordset will cause memory
> > problems
> > if it's a large recordset.
> >
> > I'm using this sort of syntax:
> >
> > adoRSdir = adocn.Execute(sSQL, lrecs)
> >
> > Do Until adoRSdir.EOF = True
> > 'this loop is running out of memory
> > Loop
> >
> > How can you monitor if you're going to run out of memory?
> > What technique would be better other than narrowing the sql
> > querystring result set?
> >
> > Thanks for your knowledge.
> >
> > Best Regards;
> >
> > Todd
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?U3VwZXJ0cmVl?=
Guest
Posts: n/a
 
      7th Apr 2005
This suggestion from Stephen Howe worked.

If same machine:
Same thing applies but now you are aware that your SQL request may cause
your database considerable overhead depending on complexity of request. I
would be tempted to do

adoRSdir.Open(SQLRequest,,,,) etc

Thanks for your responses:

"Alex Passos" wrote:

> Hi, take a look at this article it discusses some code optimization
> strategies:
>
> http://www.vbip.com/books/1861002610...er_2610_07.asp
>
> And if you are using SQL Server you can also limit your query with something
> like
>
> SELECT TOP 100 ....
>
> And then change your condition such as greater than the value of the 100th
> row for the next query.
> Make sure that from iteration to iteration you are closing the recordset and
> releasing its memory by setting it to null when the iteration completes.
>
> Alex
>
> "Supertree" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi;
> >
> > I have to write custom data integrity utilities comparing files with table
> > data.
> > I've found that looping through an ado recordset will cause memory
> > problems
> > if it's a large recordset.
> >
> > I'm using this sort of syntax:
> >
> > adoRSdir = adocn.Execute(sSQL, lrecs)
> >
> > Do Until adoRSdir.EOF = True
> > 'this loop is running out of memory
> > Loop
> >
> > How can you monitor if you're going to run out of memory?
> > What technique would be better other than narrowing the sql
> > querystring result set?
> >
> > Thanks for your knowledge.
> >
> > Best Regards;
> >
> > Todd
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My available memory is down to very little, yet my PF Usage is 8 gigabytes (about how much memory is on the box), sql server keeps having memory issues yet the sqlservr.exe is using hardly any memory.. how to fix this? is there some way to limit how Daniel Microsoft Windows 2000 Security 1 30th Aug 2007 07:38 AM
My available memory is down to very little, yet my PF Usage is 8 gigabytes (about how much memory is on the box), sql server keeps having memory issues yet the sqlservr.exe is using hardly any memory.. how to fix this? is there some way to limit how Daniel Microsoft Windows 2000 1 30th Aug 2007 01:22 AM
My available memory is down to very little, yet my PF Usage is 8 gigabytes (about how much memory is on the box), sql server keeps having memory issues yet the sqlservr.exe is using hardly any memory.. how to fix this? is there some way to limit how Daniel Microsoft Windows 2000 Networking 0 28th Aug 2007 12:38 AM
My available memory is down to very little, yet my PF Usage is 8 gigabytes (about how much memory is on the box), sql server keeps having memory issues yet the sqlservr.exe is using hardly any memory.. how to fix this? is there some way to limit how Daniel Microsoft Windows 2000 Advanced Server 0 28th Aug 2007 12:38 AM
Access 2003 stops running with out of memory, but memory is there! =?Utf-8?B?QmFybmV5?= Microsoft Access VBA Modules 4 6th Jan 2006 05:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:14 PM.