?
Solved

SQL Server 2008 Out of Memory

Posted on 2013-05-28
10
Medium Priority
?
303 Views
Last Modified: 2013-05-29
Hi..
I'm running a large stored procedure on SQL 2008 64bit and I get the following error
. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.
It uses a cursor and the server has 16GB of memory.
Any ideas?
thanks
0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 39201587
That seems like an awful lot of memory to get eaten up.  I suspect the stored procedure is not running correctly.
0
 
LVL 1

Author Comment

by:JElster
ID: 39201646
The database has 100M rows. .The SP updates a table with 10M.
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 39201681
The stored procedure is updating 10 million rows??
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 1

Author Comment

by:JElster
ID: 39201703
yes
0
 
LVL 15

Accepted Solution

by:
David L. Hansen earned 1600 total points
ID: 39201798
I'd break up the procedure into multiple ones.  So if your procedure handled all customers, for example, I'd have one procedure to handle last_names from A to F then one from G to L and so on.  Is this doable in your situation?  This is just off the top of my head.
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 39204585
Hope that helps.  By the way, you could still accomplish all of this through one procedure (just have it use the other in whatever sequence makes the most sense.
0
 
LVL 1

Author Comment

by:JElster
ID: 39204594
Must be some SQL settings to avoid this..
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 39204607
Perhaps, I'll look into it.  
BTW, are you using transactions in the script?  Transactions with rollbacks being held as a possible option, greatly impacts the amount of memory needed to accomplish such tasks.
0
 
LVL 1

Author Comment

by:JElster
ID: 39204621
No tranascations
0
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 39205866
Here are the best tips I can give you as far as settings are concerned:
http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question