Solved

SQL Server 2008 Out of Memory

Posted on 2013-05-28
10
300 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 1

Author Comment

by:JElster
ID: 39201703
yes
0
 
LVL 15

Accepted Solution

by:
David L. Hansen earned 400 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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