March 10, 2010 at 12:11 pm
Good day,
We've had a few server crashes lately due to memory, so I'm trying to get a real good understanding of how memory works.
Setup is SS 2008 Standard, Win 2003 Standard, 4 gb memory, AWE is not enabled, all default SQL settings.
I thought I had a decent grasp of the concepts - the buffer pool, AWE, data pages, page file, etc. I monitor perfmon fairly regularly looking at working set, target and total server memory, page life expectancy, etc. So I'm not a total rookie...
I'm trying to intentionally crash a test server, so I can see exactly what type of actions will do this. My ultimate goal is to be able to tell developers "when you do a, b, and c that will probably crash the server". At the same time, a better understanding will allow me to better plan how much memory each server requires.
So, I tried a few different things like setting max server memory real low to 512 MB, then writing inefficient queries (no indexes, functions everywhere) insuring table scans to make sure every page had to be read. I did this on several connections at the same time against tables anywhere from 5 - 10 GB in size and couldn't crash the server.
I was hoping someone could tell me "do this, that, and this other thing at the same time and you'll probably crash your server".
Thanks!
March 10, 2010 at 2:04 pm
We've had a few server crashes lately due to memory, so I'm trying to get a real good understanding of how memory works.
With this message?
Error: 701, Severity: 17, State: 123.
There is insufficient system memory to run this query.
Causes are running dlls within the SQL Server address space including:
a) Linked Servers
b) Any OLE/COM components loaded in SQL Server sp_OA*s
c) Extended Stored Procedures ( xp_*)
d) sp_xml_preparedocument
e) SQL Mail components
f) SQL CLR
Take a look at "Understanding the VAS Reservation (aka MemToLeave) in SQL Server" at
SQL = Scarcely Qualifies as a Language
March 10, 2010 at 4:32 pm
Henry_Lee (3/10/2010)
Good day,We've had a few server crashes lately due to memory, so I'm trying to get a real good understanding of how memory works.
Setup is SS 2008 Standard, Win 2003 Standard, 4 gb memory, AWE is not enabled, all default SQL settings.
I thought I had a decent grasp of the concepts - the buffer pool, AWE, data pages, page file, etc. I monitor perfmon fairly regularly looking at working set, target and total server memory, page life expectancy, etc. So I'm not a total rookie...
I'm trying to intentionally crash a test server, so I can see exactly what type of actions will do this. My ultimate goal is to be able to tell developers "when you do a, b, and c that will probably crash the server". At the same time, a better understanding will allow me to better plan how much memory each server requires.
So, I tried a few different things like setting max server memory real low to 512 MB, then writing inefficient queries (no indexes, functions everywhere) insuring table scans to make sure every page had to be read. I did this on several connections at the same time against tables anywhere from 5 - 10 GB in size and couldn't crash the server.
I was hoping someone could tell me "do this, that, and this other thing at the same time and you'll probably crash your server".
Thanks!
It doesn't sound like a bad server setting... it sounds like a memory leak in someone's code. Are you using sp_OA* at all? Maybe a poorly formed CLR? Someone not closing global cursors or global temp tables? There are a lot of things that can cause a memory leak.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 11, 2010 at 5:55 am
Thanks Carl.
Actually the message was this:
Error: 701, Severity: 17, State: 123.
There is insufficient system memory in resource pool 'internal' to run this query.
Of your list of suggestions to look at the only one we do a lot of is linked servers.
How do you typically monitor how much memory is being consumed by the different items on your list? Do you have any particular DMV's or perfmon counters you like to look at to help diagnose this?
Thanks again.
March 11, 2010 at 5:59 am
Thanks Jeff.
We don't really use xp's or CLR. Good suggestion on global temp tables, I believe folks know the difference between local and global temp tables, but I will investigate to make sure we're using those properly.
March 11, 2010 at 7:11 am
Now that I've said it, the temp table thing is probably the least of your worries because they automatically drop... temp tables drop when the current session ends... globabl temp tables drop when all sessions using them ends. Same goes for most cursors. IIRC, there may be issues with connection pooling for those.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 11, 2010 at 7:15 am
Just a thought... are any other apps besides SQL Server running on that particular box?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 11, 2010 at 7:20 am
March 11, 2010 at 7:23 am
Jeff,
The only other services of note are Symantec Critical System Protection and Symantec Endpoint Protection.
I know there's lots of discussion out there about AV on SQL boxes, but I don't know enough about the subject myself. I believe we're omitting the mdf's and ldf's from being scanned, so I thought that was good enough.
March 12, 2010 at 10:35 am
Found this:
SQL Server reports 701: "There is insufficient memory to run this query" when executing large batches
http://support.microsoft.com/kb/2001221
http://support.microsoft.com/kb/2000380
I also recall a SQL Server 2008 "memory leak" condition with linked servers but cannot find a KB url.
SQL = Scarcely Qualifies as a Language
March 12, 2010 at 1:17 pm
Good find, thanks Carl.
March 12, 2010 at 1:44 pm
A couple jobs ago on a sql server 2005 standard edition instance I had a problem like that with a memory leak. Randomly, even when the server wasn't busy I'd get a memory dump then that error message with the next query that ran. It would happened every couple of weeks and drove me nuts. After ruling out all the things Jeff mentioned I looked at anything that wasn't SQL related that ran on the server and found that a previous admin had installed APC Powershoot. After I uninstalled it I never had another memory leak issue with that server.
---------------------------------------------------------------------
Use Full Links:
KB Article from Microsoft on how to ask a question on a Forum
March 15, 2010 at 6:31 am
Thanks tstaker.
The only other services on the box are Symantec. If I can't find anything on the SQL side, I'll take a good look at Symantec.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply