Solved

SQL Server 2008 Out of Memory

Posted on 2013-05-28
10
296 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Syntax: How to force case sensitive query? 2 56
MS SQL Server select from Sub Table 14 42
Parse this column 6 35
SQL parsing XML works but want to do it another way 4 22
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, …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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