<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Karthick PK &amp;#39;s Blog</title><subtitle type="html">Karthick PK&amp;#39;s technical blog covering topics such as SQLServer troubleshooting, technologies and security.</subtitle><id>http://blogs.msdn.com/b/karthick_pk/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/karthick_pk/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2012-06-15T09:39:00Z</updated><entry><title>SQL Server memory - Internals</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2013/03/16/sql-server-memory.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2013/03/16/sql-server-memory.aspx</id><published>2013-03-17T05:56:00Z</published><updated>2013-03-17T05:56:00Z</updated><content type="html">&lt;p&gt;&lt;strong&gt;SQL Server memory works in different ways in 32-Bit and 64-Bit operating systems.&amp;nbsp; Let us have a deep dive in this blog on how SQL Server memory works in 32-Bit and 64-Bit systems. We will also see how SQL Server memory managers behave differently on different memory models.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before we jump in to Architecture of SQL Server memory if you are planning to make configuration changes or troubleshooting SQL Server memory errors&amp;nbsp; refer below blogs else continue reading this blog&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mssqlwiki.com/sqlwiki/sql-performance/troubleshooting-sql-server-memory/" target="_blank"&gt;Troubleshooting steps for all SQL Server Memory errors&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mssqlwiki.com/2012/06/27/a-significant-part-of-sql-server-process-memory-has-been-paged-out/" target="_blank"&gt;Trouble shooting working set trim &amp;ldquo;A significant part of SQL Server process memory has been paged out&amp;rdquo;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mssqlwiki.com/2013/03/26/sql-server-lock-pages-in-memory/" target="_blank"&gt;SQL Server lock pages in memory should I use it?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mssqlwiki.com/2012/12/04/sql-server-memory-leak/" target="_blank"&gt;SQL Server memory leak&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mssqlwiki.com/2012/10/21/sql-server-2012-memory-2/" target="_blank"&gt;What is new in SQL Server 2012 Memory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="How to set max server memory and min server memory" href="http://mssqlwiki.com/2013/04/22/max-server-memory-do-i-need-to-configure/"&gt;How to set max server memory and min server memory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Let us start with how SQL Server is designed to work on 32-Bit operating systems and then jump to 64-Bit memory model.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. 32-Bit SQL Server memory architecture &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the Win32 memory architecture, each process has a 4 GB address space. By default, 2 GB of that address space is accessible from user mode(Application like SQL Server) and the remaining 2 GB is accessible from kernel mode&lt;/p&gt;
&lt;p&gt;So in 32 Bit windows architecture 2 GB of memory is maximum available for SQL Server. &lt;br /&gt;Note: When /3GB switch is enabled user mode address space becomes 3GB and kernel mode becomes 1 GB. When 32-Bit SQL Server is running on 64-Bit windows (WOW64) It gets 4GB of user address space .It can also leverage AWE on WOW64 mode and can use more than 4GB.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mssqlwiki.files.wordpress.com/2012/01/memoryarchix86.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/7167.clip_5F00_image002_5F00_0DAC3085.png" alt="clip_image002" width="540" height="410" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;SQL Server "User address space" is broken into two regions: MemToLeave and Buffer Pool&lt;/p&gt;
&lt;p&gt;Size of MemToLeave (MTL) and Buffer Pool (BPool) is determined by SQL Server during start up as below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MTL (Memory to Leave)= (Stack size * max worker threads) + Additional space (By default 256 MB and can be controlled by -g). &lt;/strong&gt;&lt;strong&gt; &lt;br /&gt;&lt;strong&gt;Stack size =512 KB per thread for 32 Bit SQL Server &lt;/strong&gt; &lt;br /&gt;&lt;strong&gt;I.e = (256 *512 KB) + 256MB =384MB&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Additional space to load Dll&amp;rsquo;s= 256 MB from SQLServer2000. This space is used to store&lt;/p&gt;
&lt;p&gt;1. COM objects&lt;/p&gt;
&lt;p&gt;2. Extended stored procedure&lt;/p&gt;
&lt;p&gt;3. Memory allocated by linked servers (loaded in process ) or other Dll&amp;rsquo;s loaded&amp;nbsp; in SQL Server proce&lt;/p&gt;
&lt;p&gt;4. Memory allocated by SQL Server memory manger if the allocation size in greater than 8K and need&amp;rsquo;s contiguous memory (Multiple_pages_kb).&lt;/p&gt;
&lt;p&gt;5. SQLCLR&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note: &lt;/strong&gt;Additional space to load Dll&amp;rsquo;s can be modified using -g startup parameter.&lt;/p&gt;
&lt;p&gt;on any machine with less than 4 processors the Maximum worker Thread&amp;rsquo;s is &lt;br /&gt;always 256 by default (unless we change the value using SP_configure)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SQL Server Buffer Pool is minimum of &amp;ldquo;Physical RAM &amp;ldquo; or &amp;ldquo;user mode memory(2GB or 3GB) &amp;ndash; MTL-&amp;nbsp; BUF structures&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;BPool = Minimum (Physical memory, User address space &amp;ndash; MTL) &amp;ndash; BUF structures&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To ensure MemToLeave allocations are contiguous SQL Server reserves MTL first, then all the buffer pool regions and finally free MemtoLeave region.&lt;/p&gt;
&lt;p&gt;What is in BPOOL? &lt;br /&gt;Data Pages/Index pages and Memory allocated by SQL Server memory&amp;nbsp; manager, which is accounted for&amp;nbsp; any of below memory clerk&amp;rsquo;s. If the memory&lt;/p&gt;
&lt;p&gt;request is &amp;lt;= 8 KB&lt;/p&gt;
&lt;p&gt;CACHESTORE_PHDR &lt;br /&gt;CACHESTORE_XMLDBTYPE &lt;br /&gt;CACHESTORE_EVENTS &lt;br /&gt;MEMORYCLERK_SQLSTORENG &lt;br /&gt;MEMORYCLERK_XE &lt;br /&gt;CACHESTORE_XPROC &lt;br /&gt;OBJECTSTORE_SNI_PACKET &lt;br /&gt;CACHESTORE_BROKERRSB &lt;br /&gt;OBJECTSTORE_SERVICE_BROKER &lt;br /&gt;MEMORYCLERK_SQLSERVICEBROKERTRANSPORT &lt;br /&gt;MEMORYCLERK_XE_BUFFER &lt;br /&gt;CACHESTORE_XMLDBATTRIBUTE &lt;br /&gt;MEMORYCLERK_SQLOPTIMIZER &lt;br /&gt;USERSTORE_OBJPERM &lt;br /&gt;USERSTORE_TOKENPERM &lt;br /&gt;CACHESTORE_FULLTEXTSTOPLIST &lt;br /&gt;MEMORYCLERK_SQLGENERAL &lt;br /&gt;MEMORYCLERK_SQLHTTP &lt;br /&gt;CACHESTORE_NOTIF &lt;br /&gt;CACHESTORE_XMLDBELEMENT &lt;br /&gt;OBJECTSTORE_LOCK_MANAGER &lt;br /&gt;MEMORYCLERK_SQLBUFFERPOOL &lt;br /&gt;MEMORYCLERK_SQLSOAP &lt;br /&gt;MEMORYCLERK_TRACE_EVTNOTIF &lt;br /&gt;CACHESTORE_CONVPRI &lt;br /&gt;MEMORYCLERK_QSRANGEPREFETCH &lt;br /&gt;CACHESTORE_BROKERREADONLY &lt;br /&gt;MEMORYCLERK_SQLCLRASSEMBLY &lt;br /&gt;MEMORYCLERK_SOSNODE &lt;br /&gt;CACHESTORE_STACKFRAMES &lt;br /&gt;MEMORYCLERK_SQLCONNECTIONPOOL &lt;br /&gt;MEMORYCLERK_SQLSERVICEBROKER &lt;br /&gt;CACHESTORE_OBJCP &lt;br /&gt;MEMORYCLERK_SQLQUERYPLAN &lt;br /&gt;OBJECTSTORE_SECAUDIT_EVENT_BUFFER &lt;br /&gt;OBJECTSTORE_LBSS &lt;br /&gt;MEMORYCLERK_FULLTEXT &lt;br /&gt;CACHESTORE_TEMPTABLES &lt;br /&gt;CACHESTORE_BROKERTBLACS &lt;br /&gt;MEMORYCLERK_SQLXML &lt;br /&gt;USERSTORE_SXC &lt;br /&gt;MEMORYCLERK_BHF &lt;br /&gt;CACHESTORE_SQLCP &lt;br /&gt;CACHESTORE_SYSTEMROWSET &lt;br /&gt;USERSTORE_SCHEMAMGR &lt;br /&gt;MEMORYCLERK_SQLQUERYCOMPILE &lt;br /&gt;CACHESTORE_BROKERTO &lt;br /&gt;CACHESTORE_BROKERKEK &lt;br /&gt;MEMORYCLERK_SNI &lt;br /&gt;MEMORYCLERK_FULLTEXT_SHMEM &lt;br /&gt;CACHESTORE_BROKERUSERCERTLOOKUP &lt;br /&gt;USERSTORE_DBMETADATA &lt;br /&gt;CACHESTORE_VIEWDEFINITIONS &lt;br /&gt;MEMORYCLERK_SQLQUERYEXEC &lt;br /&gt;CACHESTORE_BROKERDSH &lt;br /&gt;MEMORYCLERK_SQLSOAPSESSIONSTORE &lt;br /&gt;MEMORYCLERK_SQLQERESERVATIONS &lt;br /&gt;MEMORYCLERK_HOST &lt;br /&gt;MEMORYCLERK_SQLCLR &lt;br /&gt;MEMORYCLERK_SQLXP &lt;br /&gt;MEMORYCLERK_SQLUTILITIES&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is in MTL(Non-Bpool)? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;COM Objects &lt;br /&gt;SQL Server CLR &lt;br /&gt;Memory allocated by Linked Server OLEDB Providers and third party DLL&amp;rsquo;s loaded in SQL Server process &lt;br /&gt;Extended Stored Procedures: &lt;br /&gt;Network Packets &lt;br /&gt;Memory consumed by memory managers. If the memory request is &amp;gt; 8 KB and needs contiguous allocation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; &lt;br /&gt;&lt;strong&gt;What is BUF structures? &lt;/strong&gt; &lt;br /&gt;&lt;/strong&gt;SQL Server maintains a BUF structure for each page. This structure is used to track status information associated with each buffer, such as the buffer latch, a pointer to the actual 8 KB page, status bits that indicate whether the page is dirty, has an IO in progress etc. &lt;br /&gt;Note: When AWE is enabled BUF structure is maintained for entire RAM to adjust Max server memory with out restarting SQL Server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is PAE?&lt;/strong&gt; &lt;br /&gt;PAE is the added ability of the 32 Bit processor to address more than 4 GB of physical memory. Enable /PAE &lt;br /&gt;in boot.ini to make operating system take advantage of physical memory over 4GB in system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is AWE in SQL Server? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When AWE is enabled, SQL Sever 32-Bit will be able to address more than 4 GB of physical memory using AWE allocator API&amp;rsquo;s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&amp;nbsp; In 32-Bit SQL Server Only data pages an index pages can be placed in AWE memory. So the memory available for other SQL Server memory objects is still limited to user address apace.&lt;/p&gt;
&lt;p&gt;Memory allocated using&amp;nbsp; AWE allocator API&amp;rsquo;s are not part of Process working set ,hence can not be paged out and not visible in as private bytes or working set in task manger and perfmon. &lt;br /&gt;Lock pages in memory privilege is required for startup account of SQL Server to use AWE allocator API&amp;rsquo;s. &lt;br /&gt;In 64-Bit systems sp_configure &amp;lsquo;awe enabled&amp;rsquo; does not have any functionality, If you have LPM privilege for Startup account of SQL Server AWE allocator API&amp;rsquo;s are used to allocate memory.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is /3GB Switch?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/3GB&lt;/strong&gt; switch is used in the Boot.ini file.&lt;/p&gt;
&lt;p&gt;When we enable /3GB. User address space of SQL Server or any application that uses IMAGE_FILE_LARGE_ADDRESS_AWARE will increase to 3GB restricting kernel-mode address space to 1GB.&lt;/p&gt;
&lt;p&gt;When the physical RAM in the system exceeds 16 GB and the /3GB switch is used, the operating system will ignore the additional RAM until the /3GB switch is removed. This is because of the increased size of the kernel required to support more Page table Entries&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How AWE works and What are AWE allocator APIS? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;AWE API&amp;rsquo;s enables&amp;nbsp; programs to address more memory than the 4 GB that is available through standard 32-bit addressing.&lt;/p&gt;
&lt;p&gt;How AWE APIS&amp;rsquo;s are used ? &lt;br /&gt;&lt;strong&gt;Allocate address space for mapping AWE pages.&amp;nbsp; &lt;/strong&gt;&lt;strong&gt; &lt;br /&gt;&lt;strong&gt;ADD&lt;/strong&gt;&lt;/strong&gt;=VirtualAlloc(lpaddress,size,MEM_RESERVE | MEM_PHYSICAL,PAGE_READWRITE); &lt;br /&gt;&lt;strong&gt;Allocate physical memory which can not to paged. &lt;/strong&gt; &lt;br /&gt;bResult=AllocateUserPhysicalPages(GetCurrentProcess(),&amp;amp;sizemap,&lt;strong&gt;aRAMPages&lt;/strong&gt;); &lt;br /&gt;&lt;strong&gt;MAP a view of that page into your address space, &lt;/strong&gt;&lt;strong&gt; &lt;br /&gt;&lt;/strong&gt;bResult=MapUserPhysicalPages(&lt;strong&gt;ADD&lt;/strong&gt;,sizemap,&lt;strong&gt;aRAMPages&lt;/strong&gt;);&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. 64-Bit SQL Server memory architecture &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the 64-Bit windows each process gets up to 8 TB of address space, Hence there was no need for SQL Server to leave certain amount of addressable memory for Non-Bpool allocations.&lt;/p&gt;
&lt;p&gt;There are three types of memory model&amp;rsquo;s in 64-Bit SQL Server.&lt;/p&gt;
&lt;p&gt;1. Conventional &amp;ndash; Normal physical page size (4 / 8KB),memory can be paged, dynamic &lt;br /&gt;2. Locked &amp;ndash; Normal physical page size (4 / 8KB), Bpool can not be paged, dynamic, Requires startup account of SQL Server to have "Lock pages in memory" privilege,Memory is allocated by&amp;nbsp; using Address Windowing Extensions (AWE) API&amp;rsquo;s &lt;br /&gt;3. Large &amp;ndash; Large physical page size ( &amp;gt; = 2MB), Non-pageable, static, Memory is committed at startup,&amp;rdquo;Max server memory&amp;rdquo; is recommended, requires startup account of SQL Server to have "Lock pages in memory" privilege&lt;/p&gt;
&lt;p&gt;Memory calculations in 64-Bit SQL Server are straight forward. &lt;br /&gt;SQL Server calculates the size of RAM during the startup and reserve it , minimum of (reserved space, &amp;ldquo;Max server memory&amp;rdquo;) is used as Bpool.&lt;/p&gt;
&lt;p&gt;Similar to 32-Bit SQL Server, there will be memory allocations outside Bpool in 64-Bit SQL Server , which is called as Non-Bpool allocations.&lt;/p&gt;
&lt;p&gt;Who allocates memory outside Bpool?&lt;/p&gt;
&lt;p&gt;1. COM Objects &lt;br /&gt;2. SQL Server CLR &lt;br /&gt;3. Memory allocated by Linked Server OLEDB Providers and third party DLL&amp;rsquo;s loaded in SQL Server process &lt;br /&gt;4. Extended Stored Procedures: &lt;br /&gt;5. Network Packets &lt;br /&gt;6. Memory consumed by memory managers. If the memory request is greater than 8 KB and needs contiguous allocation.&amp;nbsp; &lt;br /&gt;7. Backup &lt;br /&gt;8. Memory for threads (stack size is 2 MB in 64-BIT SQL )&lt;/p&gt;
&lt;p&gt;Max server memory controls only the Bpool, it doesn&amp;rsquo;t control Non-Bpool allocations, this is the reason for SQL Server&amp;rsquo;s memory usage being greater than "Max Server memory".&lt;/p&gt;
&lt;p&gt;Key points:&lt;/p&gt;
&lt;p&gt;1. When &amp;ldquo;Lock pages in memory is used&amp;rdquo; operating system can not page out Bpool, Non-Bpool allocations can still be paged.&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp; SP_configure &amp;ldquo;awe enabled&amp;rdquo; option doesn&amp;rsquo;t have any use in 64-Bit SQL Server.&lt;/p&gt;
&lt;p&gt;3. &amp;ldquo;Max Server Memory&amp;rdquo; limits only Bpool, hence SQL Server memory usage will be greater than &amp;ldquo;Max server memory&amp;rdquo;&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp; If your operating system is windows2003 (Windows2008 is your call) make sure you cap the SQL Server MAX Server Memory after considering the memory required by other applications, Operating system, Drivers , SQL Server Non- Bpool allocations etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Above architecture is applicable till SQL Server 2008 R2. SQL Server 2012 (Denali) has made many changes to the memory manager to govern the SQL Server memory consumption in efficient way compared with earlier versions. To learn SQL Server 2012 Memory refer &lt;a href="http://mssqlwiki.com/tag/sql-server-2012-memory-architecture/"&gt;&lt;strong&gt;THIS LINK&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10402967" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="in memory sql server" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/in+memory+sql+server/" /><category term="sql server 2008 memory" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+2008+memory/" /><category term="memory sql server" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/memory+sql+server/" /><category term="sql server 2005 memory" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+2005+memory/" /><category term="sql server in memory" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+in+memory/" /></entry><entry><title>Query optimization</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/11/22/tuning_2D00_sql_2D00_server_2D00_query.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/11/22/tuning_2D00_sql_2D00_server_2D00_query.aspx</id><published>2012-11-22T06:08:10Z</published><updated>2012-11-22T06:08:10Z</updated><content type="html">&lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;If you would like to Optimize your SQL Server Query, Tune slow queries in SQL Server and make them run faster&amp;#160; follow the steps in below blog&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;A query in considered to be slow when it is executing for longer duration than expected. Total duration of the query can be broken in to compile time, CPU time and Wait time.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Before you start troubleshooting the query which is running for longer duration, Identify if the query is slow because it is long waiting (or) Long running (or) Long compiling.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;Compile time:&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt;Time taken to compile the query.&amp;#160; compile time can be identified by looking at the &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;1. CompileTime=&amp;quot;n&amp;quot;&amp;#160; in XML plan &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;2. SQL Server parse and compile time when Set statistics time on is enabled.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;CPU time:&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; Time taken by the query in CPU (Execution time – (compile time+ wait time). CPU time can be identified by looking at the &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;1. CPU column in profiler. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;2.&amp;#160; CPU time under SQL Server Execution Times when statistics time on is enabled.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;Execution time:&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; Time taken by the query for complete execution ( Execution time +CPU time +Wait time). Total duration of the query can be identified by using the &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;1.Duration column in profiler&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;2. SQL Server Execution Times, elapsed times when statistics time on is enabled.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;What is long waiting query?&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;A query is considered to be long waiting query, when it spend most of its time waiting for some resource. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;How to identify if the query is long waiting?&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Long running query can be identified by comparing the CPU and duration column in profiler (or) CPU and elapsed time when statistics time on is set .&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;When a query is waiting for a resource (such as lock, network I/O, Page_I/O Etc) it will not&amp;#160; consume CPU.&amp;#160; So if you see duration being higher than CPU (Difference between Duration and&amp;#160; CPU is wait time),It indicates that the query has spent large amount of time waiting for some resource.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Let us see an example of long waiting query. I have collected profiler trace while executing the query.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;set statistics io on &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;set statistics time on &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;go &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span&gt;&lt;font color="#c00000"&gt;--Place your query here&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;select top 10000 * from a &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;go &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;set statistics io off &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;set statistics time off &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt 0.5in" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;go&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/5633.clip_5F00_image0013_5F00_30519BDA.jpg"&gt;&lt;span style="mso-themecolor: text2; text-underline: none; mso-no-proof: yes"&gt;&lt;span style="mso-ignore: vglayout"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/5226.clip_5F00_image00115_5F00_1C580944.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[15]" border="0" alt="clip_image001[15]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/4456.clip_5F00_image00115_5F00_thumb_5F00_53BE1A72.jpg" width="984" height="45" /&gt;&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Look at the Duration and CPU column in the profiler &lt;/font&gt;&lt;/span&gt;&lt;b&gt;&lt;span&gt;&lt;font color="#c00000"&gt;Cpu=256 and duration =1920.&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt; So this query has spent majority of time waiting for some resource. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/6281.clip_5F00_image0024_5F00_26C8B797.jpg"&gt;&lt;span style="mso-themecolor: text2; text-underline: none; mso-no-proof: yes"&gt;&lt;span style="mso-ignore: vglayout"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/0815.clip_5F00_image00216_5F00_36F47F90.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002[16]" border="0" alt="clip_image002[16]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-17-85-metablogapi/7245.clip_5F00_image00216_5F00_thumb_5F00_47204789.jpg" width="1049" height="211" /&gt;&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Look at the output of statistics time and statistics I/O in above image. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;SQL Server has spent only 2 milliseconds compiling the query and 256 milliseconds on CPU, but the overall duration was 1920 milliseconds so the query has spent maximum time waiting for some resource.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Identify the resource in which this query is waiting on using one of the steps listed below.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;font color="#1f497d"&gt;&lt;span style="mso-themecolor: text2"&gt;1. Look at the wait type column of the &lt;/span&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;sysprocesses&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-themecolor: text2"&gt; for the spid which is executing query while the query is executing.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;2. If there is no other activity on the server collect sys.dm_os_wait_stats output before and after the query execution and identify the wait (Will not help in tuning queries running for short duration)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;3. Collect XEvent to gather the wait stats of individual query.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Once you identify the resource in which the query is waiting on tune the resource. Most of the times queries would be slow waiting for below resource.&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;PAGEIOLATCH_* or Write log:&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; This indicates I/O resource bottleneck follow the detailed troubleshooting steps mentioned in&amp;#160; &lt;a href="http://mssqlwiki.com/2012/08/27/io-requests-taking-longer-than-15-seconds-to-complete-on-file/" target="_blank"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;strong&gt;This Link&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt; to fix the I/O bottleneck. If you find SQL Server spawning excessive I/O Create necessary indexes. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 1in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;a. Logical reads + Physical reads in statistics I/O output (Refer above image) or Reads and writes in profiler will indicate the I/O posted by this query. If you see very high reads for query compared with the result rest retuned by query it is an indication of&amp;#160; missing indexes or bad plan. Create necessary indexes (You can use DTA for index recommendations.).&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;PAGELATCH_*:&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; This waittype in sysprocesses indicates that SQL Server is waiting on access to a database page, but the page is not undergoing physical IO.&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: -0.25in; margin: 0in 0in 12pt 1.25in"&gt;&lt;font color="#1f497d"&gt;&lt;span style="mso-themecolor: text2; mso-fareast-font-family: calibri"&gt;a.&lt;/span&gt;&lt;span style="mso-themecolor: text2; mso-fareast-font-family: calibri"&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 7pt"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-themecolor: text2"&gt;This problem is normally caused by a large number of sessions attempting to access the same physical page at the same time. We should Look at the wait resource of the spid The wait_resource is the page number (the format is&amp;#160; dbid:file:pageno) that is being accessed.&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;b. We can use DBCC PAGE to identify object or type of the page in which we have the contention. Also it will help us to determine&amp;#160; whether contention&amp;#160; is for allocation, data or text.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 1in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;c. If the pages that SQL Server is most frequently waiting on are in Tempdb database ,check the wait resource column for a page number in dbid 2 Ex(2:1:1 or 1:1:2). Enable TF 1118 and increase the number of TEMPDB data files and size them&amp;#160; equally (You may be facing tempdb&amp;#160;&amp;#160; llocation latch contention mentioned in &lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/328551"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;http://support.microsoft.com/kb/328551&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;font color="#1f497d"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 1in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;d. If the page is in a user database, check to see if the table has a clustered index on a monotonic key such as an identity where all threads are contending for the same page at the end of the table.&amp;#160; In this case we need to choose a different clustered index key to spread the work across different pages.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;LATCH_*:&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt;&amp;#160;&amp;#160;&amp;#160; Non-buf latch waits can be caused by variety of things.&amp;#160; We can use the wait resource column in sysprocesses to determine the type of latch involved(KB 822101).&amp;#160; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;a. A very common LATCH_EX wait is due to running a profiler trace or sp_trace_getdata Refer KB 929728 for more information.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;b. Auto Grow and auto shrink while query is executed.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;c. Queries going for excessive parallelism.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;Blocking (LCK*):&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; Use the query in &lt;a href="http://mssqlwiki.com/2010/11/24/script-to-get-current-blocking-tree-with-wait-types/" target="_blank"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;This Link&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&amp;#160; to identify the blocking. Tune the head blocker.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;Asynch_network_io (or) network IO:&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; Keep the result set returned by the query smaller. Follow detailed troubleshooting refer&amp;#160; &lt;a href="http://mssqlwiki.com/sqlwiki/sql-performance/async_network_io-or-network_io/"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;strong&gt;This Link&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;Resource_semaphore waits:&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; Make sure there is no memory pressure on the server Follow steps in &lt;a href="http://mssqlwiki.com/2012/10/12/what-is-resource_semaphore_query_compile/" target="_blank"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;strong&gt;This Link&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&amp;#160; for detailed troubleshooting.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;SQL Trace: &lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt;Stop all the profiler traces running on the server. Identify the traces which are running on the server using the query in &lt;a href="http://mssqlwiki.com/2010/04/26/how-to-find-all-the-profiler-traces-running-on-my-sql-server/" target="_blank"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;strong&gt;This Link&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;Cx packet: &lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt;Set the Max degree of parallelism. But remember Cxpacket wait type is not always a problem. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;a. For servers that have eight or less processors, use the following configuration where N equals the number of processors: max degree of parallelism = 0 to N . &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;b. For servers that use more than eight processors, use the following configuration: max degree of parallelism = 8.Refer &lt;a href="http://support.microsoft.com/kb/2023536"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;strong&gt;This Link&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;font color="#1f497d"&gt;&lt;strong&gt;&lt;span style="mso-themecolor: text2"&gt;SOS_SCHEDULER_YIELD :&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-themecolor: text2"&gt; Identify if there is CPU bottleneck on the server. This waiting means that the thread is waiting for CPU. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 1in"&gt;&lt;font color="#1f497d"&gt;&lt;span style="mso-themecolor: text2"&gt;a. &lt;/span&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 7pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-themecolor: text2"&gt;SQL Server worker thread’s Quantum target is 4ms which means the thread(worker) Will ( is expected to) yield back to SQL Server scheduler when it exceeds 4ms and before it yields back it check if there are any other runnable threads, If there is any runnable threads then the thread which is in top of runnable list is&amp;#160; scheduled and current thread will go to the tail of the runnable list and will get rescheduled when the other threads which are already waiting in SOS Scheduler (runnable list) finishes its execution or quantum. The time thread spends in runnable list waiting for its quantum is accounted as SOS_SCHEDULER_YIELD. You will see this type when multiple threads are waiting to get CPU cycle. Follow trouble shooting the steps mentioned &lt;a href="http://mssqlwiki.com/2012/10/04/troubleshooting-sql-server-high-cpu-usage/"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;strong&gt;This Link&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;font color="#1f497d"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;Important:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style="mso-themecolor: text2"&gt; In SQL Server instances when there more than 1 CPU it is possible that the CPU is higher than the duration. Because CPU is sum of time spend by query in all the CPU’s when choosing a parallel whereas the duration is actual duration of the query.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="text-indent: 0.5in; margin: 0in 0in 12pt"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;What is long running query?&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;A query is considered to be long running query, when it spend most of its time on CPU and not waiting for some resource. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;How to identify if the query is long running ?&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Long running query can be identified by comparing the CPU and duration column in profiler (or) CPU and elapsed time when statistics time on is set . If the CPU and duration is close than the query is considered to be long running. If the query is long running identify where the query spend the time ,It could be for compiling or post compilation (For executing the query). compare the duration of the query with CompileTime (XML plan compile time (or) SQL Server parse and compile time when statistics time is on refer above image). &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;High Compile time:&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Compare the duration of the query with Compile Time (XML plan compile time (or) SQL Server parse and compile time when statistics time is on).Compile time will normally be in few millisecond . Follow the below steps if you see high compile time&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;1. Identify if you have large token perm refer &lt;/font&gt;&lt;a title="http://support.microsoft.com/kb/927396" href="http://support.microsoft.com/kb/927396"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;http://support.microsoft.com/kb/927396&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;2. Create necessary indexes and stats. Tune the query manually (or) in DTA and apply the recommendation &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;3. Reduce the complexity of query. Query which joins multiple tables (or) having large number of IN clause can taking&amp;#160; a while to compile.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;4. You can reduce the compile’s by using force parameterization option.&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;High CPU time:&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;Compare the duration of the query with Compile Time (XML plan compile time (or) SQL Server parse and compile time when statistics time is on).&amp;#160; If the compile time is very low compared to the duration. Then follow the below steps.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;1. Update the stats of tables and indexes used by the query (If the stats are up to date Estimated rows and estimated execution will&amp;#160; be approximately same in execution plan .If there is huge difference stats are out dated and requires update) .&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;2. Identify if the query has used bad plan because of parameter sniffing (If the ParameterCompiledValue and ParameterRuntimeValue is different in XML plan). Refer &lt;/font&gt;&lt;a href="http://mssqlwiki.com/2012/10/08/parameter-sniffing/"&gt;&lt;b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;THIS LINK&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;font color="#1f497d"&gt; to know more about Parameter Sniffing&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;3. If updating the stats and fixing the parameter sniffing doesn’t resolve the issue it is more likely optimizer is not able to create efficient plan because of lack of indexes and correct statistics. Run the query which is driving the CPU in database tuning advisor and apply the recommendations. (You will find missing index detail in xml plan but DTA is more efficient).&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;4. If the query which is running longer and consuming CPU is linked server query try changing the security of linked server to ensure linked server user has ddl_admin or dba/sysadmin on the remote server. More details regarding the issue in &lt;/font&gt;&lt;a href="http://blogs.msdn.com/b/psssql/archive/2009/09/02/distributed-queries-remote-login-permissions-and-execution-plans.aspx"&gt;&lt;b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;THIS LINK&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;font color="#1f497d"&gt;.&lt;/font&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;5. Ensure optimizer is not aborting early and creating bad plan. For details refer &lt;/font&gt;&lt;a href="http://mssqlwiki.com/2012/10/07/optimizer-timeout-or-optimizer-memory-abort/"&gt;&lt;b&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;THIS LINK&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;6. Ensure the query which is spiking the CPU doesn’t have plan guides (xml plan will have PlanGuideDB attribute.&amp;#160; Also sys.plan_guides will have entries) and query hints(index= or (option XXX join) or inner (Join Hint) join).&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 12pt 0.5in"&gt;&lt;span style="mso-themecolor: text2"&gt;&lt;font color="#1f497d"&gt;7.&amp;#160; Ensure that SET options are not changed.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 7.5pt 0in" class="MsoNormal"&gt;&lt;span style="mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-ansi-language: en" lang="EN"&gt;&lt;font face="Times New Roman"&gt;&lt;font style="font-size: 10pt" color="#1f497d"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 7.5pt 0in" class="MsoNormal"&gt;&lt;font face="Times New Roman"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-ansi-language: en" lang="EN"&gt;&lt;font style="font-size: 10pt"&gt;If you liked this post, do like us on Facebook at &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-ansi-language: en" lang="EN"&gt;&lt;a href="https://www.facebook.com/mssqlwiki"&gt;&lt;span&gt;https://www.facebook.com/mssqlwiki&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-ansi-language: en" lang="EN"&gt; and join our &lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family: &amp;#39;Times New Roman&amp;#39;; mso-ansi-language: en" lang="EN"&gt;&lt;a href="https://www.facebook.com/mssqlwiki#!/groups/454762937884205/"&gt;&lt;b&gt;&lt;span&gt;&lt;font style="font-size: 10pt"&gt;Facebook group&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; and post your questions.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 7.5pt 0in"&gt;&lt;span&gt;Thank you, &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 7.5pt 0in"&gt;&lt;span&gt;Karthick P.K |&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;&lt;font color="#0000ff"&gt;My Facebook Page&lt;/font&gt;&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;&lt;font color="#800080"&gt;My Site&lt;/font&gt;&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;&lt;font color="#0000ff"&gt;Blog space&lt;/font&gt;&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;&lt;font color="#0000ff"&gt;Twitter&lt;/font&gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;  &lt;h6 style="margin: 7.5pt 0in"&gt;&lt;strong&gt;&lt;u&gt;&lt;span&gt;&lt;font style="font-size: 7.5pt"&gt;Disclaimer:&lt;/font&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span&gt;&lt;/span&gt;&lt;/h6&gt;  &lt;p style="margin: 7.5pt 0in"&gt;&lt;span&gt;The views expressed on this website/blog are mine alone and do not reflect the views of my company. All postings on this blog are provided “AS IS” with no warranties, and confers no rights. &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span&gt;&lt;font style="font-size: 12pt"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10370831" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="Performance" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Performance/" /><category term="SQL General" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+General/" /><category term="sql performance" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+performance/" /><category term="sql query tuning" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+query+tuning/" /><category term="Query tuning" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Query+tuning/" /><category term="Tuning sql server query" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Tuning+sql+server+query/" /><category term="sql query optimizer" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+query+optimizer/" /><category term="query performance tuning" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/query+performance+tuning/" /><category term="query tuning in sql server" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/query+tuning+in+sql+server/" /><category term="sql server query tuning" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+query+tuning/" /><category term="query optimization" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/query+optimization/" /></entry><entry><title>Non-yielding IOCP Listener, Non-yielding Scheduler and non-yielding resource monitor known issues and fixes</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/08/21/non-yielding-iocp-listener-non-yielding-scheduler-and-non-yielding-resource-monitor-known-issues-and-fixes.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/08/21/non-yielding-iocp-listener-non-yielding-scheduler-and-non-yielding-resource-monitor-known-issues-and-fixes.aspx</id><published>2012-08-21T09:12:00Z</published><updated>2012-08-21T09:12:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Times New Roman; font-size: small;" size="3" face="Times New Roman"&gt;Do you see below errors in SQL error along with dumps and stuck?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Non-yielding IOCP Listener &lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;* BEGIN STACK DUMP: &lt;br /&gt;*&amp;nbsp;&amp;nbsp; 05/06/12 03:54:59 spid 0 &lt;br /&gt;* Non-yielding IOCP Listener &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Non-yielding Scheduler &lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;* BEGIN STACK DUMP: &lt;br /&gt;*&amp;nbsp;&amp;nbsp; 04/16/12 10:09:58 spid 6256 &lt;br /&gt;* Non-yielding Scheduler &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Non-yielding Resource Monitor&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;* BEGIN STACK DUMP&lt;/p&gt;
&lt;p&gt;*&amp;nbsp;&amp;nbsp; 01/22/09 19:11:16 spid 0&lt;/p&gt;
&lt;p&gt;* Non-yielding Resource Monitor&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Refer &lt;a title="http://mssqlwiki.com/2012/08/17/how-to-analyze-non-yielding-scheduler-dumps/" href="http://mssqlwiki.com/2012/08/17/how-to-analyze-non-yielding-scheduler-dumps/" target="_blank"&gt;How to analyze Non-Yielding scheduler or Non-yielding IOCP Listener dumps&lt;/a&gt;&amp;nbsp; for analyzing the &lt;strong&gt;Non-yielding Scheduler, &lt;strong&gt;Non-yielding IOCP Listener and Non-yielding Resource Monitor&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;If you are interested in just finding a quick resolution follow the below steps to get the Non-Yield stack from the dump and check if it is matching with any existing known issues in SQL Server.&amp;nbsp; &lt;br /&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To analyze the dump download and Install Windows Debugger from &lt;a href="http://sdrv.ms/MO6ytG"&gt;&lt;strong&gt;This&lt;/strong&gt;&lt;/a&gt;&amp;nbsp; link&lt;/p&gt;
&lt;p&gt;1. Open Windbg&lt;/p&gt;
&lt;p&gt;2. Choose File menu &amp;ndash;&amp;gt; select Open crash dump &amp;ndash;&amp;gt;Select the Dump file (SQLDump000#.mdmp)&lt;/p&gt;
&lt;p&gt;3. on command window type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;.sympath srv*c:\Websymbols*http://msdl.microsoft.com/download/symbols;&lt;/p&gt;
&lt;p&gt;4. Type .reload /f and hit enter. This will force debugger to immediately load all the symbols.&lt;/p&gt;
&lt;p&gt;5.&amp;nbsp; Type&amp;nbsp;&amp;nbsp; .cxr sqlserver!g_copiedStackInfo+0X20&amp;nbsp;&amp;nbsp; for SQL Server2005 and SQL Server2008/2008R2&amp;nbsp; (or)&amp;nbsp;&amp;nbsp; .cxr sqlmin!g_copiedStackInfo+0X20&amp;nbsp; for SQL Server2012.&lt;/p&gt;
&lt;p&gt;6.&amp;nbsp; Type kc 100 and look at the stack to see if it matches with any of the known issues in SQL Server.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: underline;"&gt;&lt;strong&gt;Stack 1&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DetachPointersIntoMemo&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DetachPointersIntoMemo&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DetachPointersIntoMemo&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DetachPointersIntoMemo&lt;/p&gt;
&lt;p&gt;sqlservr!COptContext::PcxteOptimizeQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CQuery::Optimize&lt;/p&gt;
&lt;p&gt;sqlservr!CQuery::PqoBuild&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtQuery::InitQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtDML::InitNormal&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtDML::Init&lt;/p&gt;
&lt;p&gt;sqlservr!CCompPlan::FCompileStep&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::FCompile&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::FCompWrapper&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Transform&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!ExecuteSql&lt;/p&gt;
&lt;p&gt;sqlservr!CSpecProc::ExecuteSpecial&lt;/p&gt;
&lt;p&gt;sqlservr!CXProc::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretLocalExec&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretExecExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtExecProc::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2344600/en-US" target="_blank"&gt;KB :2344600:FIX: "Non-yielding Scheduler" error may occur when you use the CONTAINSTABLE function together with many OR and AND predicates in SQL Server 2008 or in SQL Server 2008 R2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 2&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!TMatchPattern&lt;/p&gt;
&lt;p&gt;sqlservr!FMatchStrTxt&lt;/p&gt;
&lt;p&gt;sqlservr!I8CharindexStrBhI8&lt;/p&gt;
&lt;p&gt;sqlservr!CEs::GeneralEval4&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtCond::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,0&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands 0x12a&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadInitThunk&lt;/p&gt;
&lt;p&gt;ntdll!RtlUserThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2633357" target="_blank"&gt;2633357 FIX: "Non-yielding Scheduler" error might occur when you run a query that uses the CHARINDEX function in SQL Server 2008 R2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 3&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CItvlVal::Copy&lt;/p&gt;
&lt;p&gt;sqlservr!CConstraintItvl::PcnstrItvlUnion&lt;/p&gt;
&lt;p&gt;sqlservr!CConstraintProp::FBuildItvlFromOr&lt;/p&gt;
&lt;p&gt;sqlservr!CConstraintProp::FBuildItvlFromPexpr&lt;/p&gt;
&lt;p&gt;sqlservr!CConstraintProp::FAndItvlConstraint&lt;/p&gt;
&lt;p&gt;sqlservr!CConstraintProp::AndNewConstraint&lt;/p&gt;
&lt;p&gt;sqlservr!CConstraintProp::PcnstrDeriveSelect&lt;/p&gt;
&lt;p&gt;sqlservr!CLogOp_Select::PcnstrDerive&lt;/p&gt;
&lt;p&gt;sqlservr!CLogOpArg::PcnstrDeriveHandler&lt;/p&gt;
&lt;p&gt;sqlservr!CLogOpArg::DeriveGroupProperties&lt;/p&gt;
&lt;p&gt;sqlservr!COpArg::DeriveNormalizedGroupProperties&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DeriveGroupProperties&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DeriveGroupProperties 0xc6&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::DeriveGroupProperties&lt;/p&gt;
&lt;p&gt;sqlservr!CQuery::PqoBuild&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtQuery::InitQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtDML::InitNormal&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtDML::Init&lt;/p&gt;
&lt;p&gt;sqlservr!CCompPlan::FCompileStep&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::FCompile&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::FCompWrapper&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Transform&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/982376" target="_blank"&gt;KB: 982376 FIX: A non-yielding scheduler error or an error 8623 occurs when you run a query that contains a large IN clause in SQL Server 2005,SQL Server 2008, or SQL Server 2008 R2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 4&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!COptExpr::AdjustParallelPlan&lt;/p&gt;
&lt;p&gt;sqlservr!COptContext::PcxteOptimizeQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CQuery::Optimize&lt;/p&gt;
&lt;p&gt;sqlservr!CQuery::PqoBuild&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtQuery::InitQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtSelect::Init&lt;/p&gt;
&lt;p&gt;sqlservr!CCompPlan::FCompileStep&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::FCompile&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::FCompWrapper&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Transform&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/943060" target="_blank"&gt;KB: 943060 FIX: A query that has many outer joins takes a long time to compile in SQL Server 2005&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 5&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CXid::GetBlockingTask&lt;/p&gt;
&lt;p&gt;sqlservr!SNode::SearchForDeadlock&lt;/p&gt;
&lt;p&gt;sqlservr!DeadlockMonitor::SearchForDeadlock&lt;/p&gt;
&lt;p&gt;sqlservr!DeadlockMonitor::SearchAndResolve&lt;/p&gt;
&lt;p&gt;sqlservr!DeadlockMonitor::SearchTaskAndResolve&lt;/p&gt;
&lt;p&gt;sqlservr!DeadlockMonitor::WorkLoop&lt;/p&gt;
&lt;p&gt;sqlservr!lockMonitor&lt;/p&gt;
&lt;p&gt;sqlservr!lockMonitorThread&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="https://vkbexternal.partners.extranet.microsoft.com/VKBWebService/ViewContent.aspx?PortalId=1&amp;amp;scid=kb;EN-US;956854"&gt;956854 &lt;/a&gt;Cumulative update package 10 for SQL Server 2005 Service Pack 2&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 6&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ntdll!ZwQueryAttributesFile&lt;/p&gt;
&lt;p&gt;ntdll!RtlDoesFileExists_UstrEx&lt;/p&gt;
&lt;p&gt;ntdll!LdrpSearchPath&lt;/p&gt;
&lt;p&gt;ntdll!LdrpCheckForLoadedDll&lt;/p&gt;
&lt;p&gt;ntdll!LdrpLoadDll&lt;/p&gt;
&lt;p&gt;ntdll!LdrLoadDll&lt;/p&gt;
&lt;p&gt;kernel32!LoadLibraryExW&lt;/p&gt;
&lt;p&gt;mswsock!SockLoadHelperDll&lt;/p&gt;
&lt;p&gt;mswsock!SockGetTdiName&lt;/p&gt;
&lt;p&gt;mswsock!SockSocket&lt;/p&gt;
&lt;p&gt;mswsock!WSPSocket&lt;/p&gt;
&lt;p&gt;ws2_32!WSASocketW&lt;/p&gt;
&lt;p&gt;ws2_32!WSASocketA&lt;/p&gt;
&lt;p&gt;sqlservr!CreateSocket&lt;/p&gt;
&lt;p&gt;sqlservr!AcceptObject::AsyncAccept&lt;/p&gt;
&lt;p&gt;sqlservr!Tcp::AcceptDone&lt;/p&gt;
&lt;p&gt;sqlservr!SNIAcceptDoneWithReturnCode&lt;/p&gt;
&lt;p&gt;sqlservr!SNIAcceptDoneWrapper&lt;/p&gt;
&lt;p&gt;sqlservr!SNIAcceptDoneRouter&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Node::ListenOnIOCompletionPort&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2711549" target="_blank"&gt;KB 2711549 FIX: An error message is logged when you start SQL Server 2008 R2 or when a client sends a request to SQL Server 2008 R2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 7&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ntdll!ZwOpenKey&lt;/p&gt;
&lt;p&gt;advapi32!LocalBaseRegOpenKey&lt;/p&gt;
&lt;p&gt;advapi32!RegOpenKeyExW&lt;/p&gt;
&lt;p&gt;sqlservr!COledbConnect::GetProviderOptions&lt;/p&gt;
&lt;p&gt;sqlservr!COledbConnect::SetClsidFromProvider&lt;/p&gt;
&lt;p&gt;sqlservr!COledbConnect::Init&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretRemoteExec&lt;/p&gt;
&lt;p&gt;sqlservr!CRemoteProcExecLevel::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretWrapRemoteExec&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretExecExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtExec::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretLocalExec&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretExecExecute&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2468047" target="_blank"&gt;KB2468047 FIX: Error code 17883 or "Non-yielding Scheduler" error may occur when you use the OPENQUERY function on SQL Server 2005&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 8&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ntdll!ZwQueryVirtualMemory&lt;/p&gt;
&lt;p&gt;psapi!QueryWorkingSetEx&lt;/p&gt;
&lt;p&gt;sqlservr!BPool::Shrink&lt;/p&gt;
&lt;p&gt;sqlservr!BPool::ReleaseAwayBufs&lt;/p&gt;
&lt;p&gt;sqlservr!BPool::LazyWriter&lt;/p&gt;
&lt;p&gt;sqlservr!lazywriter&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="https://vkbexternal.partners.extranet.microsoft.com/VKBWebService/ViewContent.aspx?PortalId=1&amp;amp;scid=kb;EN-US;967908"&gt;967908 &lt;/a&gt;Cumulative update package 13 for SQL Server 2005 Service Pack 2 or &lt;a href="https://vkbexternal.partners.extranet.microsoft.com/VKBWebService/ViewContent.aspx?PortalId=1&amp;amp;scid=kb;EN-US;970279"&gt;970279 &lt;/a&gt;Cumulative update package 4 for SQL Server 2005 Service Pack 3&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 9&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!LatchBase::ReleaseInternal&lt;/p&gt;
&lt;p&gt;sqlservr!XVB::GetRecord&lt;/p&gt;
&lt;p&gt;sqlservr!RowsetVersionScan::GetData&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanRowsetNew::GetRowWithPrefetch&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanRowsetNew::GetRow&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanNLJoinNew::GetRowHelper&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanNLJoinNew::GetRow&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanNLJoinNew::GetRowHelper&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanNLJoinNew::GetRow&lt;/p&gt;
&lt;p&gt;sqlservr!CQueryScan::GetRow&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtQuery::InitForExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtQuery::ErsqExecuteQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtCondWithQuery::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::FExecTrigger&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::FExecAllTriggers&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::XretDMLExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;0,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtPrepQuery::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CExecuteStatement::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecStr::XretExecStrExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtExecStr::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/949595" target="_blank"&gt;KB : 949595 FIX: Error message when you run a query that uses a join condition in SQL Server 2005: "Non-yielding Scheduler"&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 10&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!SQLServerLogIter::LookupScanCache&lt;/p&gt;
&lt;p&gt;sqlservr!SQLServerLogIterForward::GetNextBlock&lt;/p&gt;
&lt;p&gt;sqlservr!SQLServerLogIterForward::GetNext&lt;/p&gt;
&lt;p&gt;sqlservr!LsMgr::GetEndOfLog&lt;/p&gt;
&lt;p&gt;sqlservr!LsMgr::ProcessInternalRollForward&lt;/p&gt;
&lt;p&gt;sqlservr!LsWorkRequest::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!LsWorker::ThreadRoutine&lt;/p&gt;
&lt;p&gt;sqlservr!LsWorker::ThreadRoutine&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/970044" target="_blank"&gt;KB 970044 FIX: Error message when you try to break database mirroring between two servers that are running SQL Server 2008: "Non-yielding Scheduler"&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 11&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CLinkedMap&lt;/p&gt;
&lt;p&gt;sqlservr!CCheckReadersAndWriters::Release&lt;/p&gt;
&lt;p&gt;sqlservr!CMainIlb::~CMainIlb&lt;/p&gt;
&lt;p&gt;sqlservr!CBlobHandleFactoryMain::ReleaseILockBytes&lt;/p&gt;
&lt;p&gt;sqlservr!CMainIlb::Release&lt;/p&gt;
&lt;p&gt;sqlservr!CTraceRpcBinaryStream::~CTraceRpcBinaryStream&lt;/p&gt;
&lt;p&gt;sqlservr!CTraceTvpData::~CTraceTvpData&lt;/p&gt;
&lt;p&gt;sqlservr!CRpcTraceHelper::CleanUpTraceTvpData&lt;/p&gt;
&lt;p&gt;sqlservr!CRpcTraceHelper::TracePostExec&lt;/p&gt;
&lt;p&gt;sqlservr!CRPCExecEnv::OnExecFinish&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!endthreadex&lt;/p&gt;
&lt;p&gt;msvcr80!endthreadex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadInitThunk&lt;/p&gt;
&lt;p&gt;ntdll!RtlUserThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2520808" target="_blank"&gt;KB 2520808 FIX: Non-yielding scheduler error when you run a query that uses a TVP in SQL Server 2008 or in SQL Server 2008 R2 if SQL Profiler or SQL Server Extended Events is used&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 12&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ntdll!ZwFreeVirtualMemory&lt;/p&gt;
&lt;p&gt;KERNELBASE!VirtualFree&lt;/p&gt;
&lt;p&gt;sqlservr!MemoryNode::VirtualFree&lt;/p&gt;
&lt;p&gt;sqlservr!ReservedMemBlock::FreeMemory&lt;/p&gt;
&lt;p&gt;sqlservr!MultiPageAllocator::FreePagesInternal&lt;/p&gt;
&lt;p&gt;sqlservr!MultiPageAllocator::FreePages&lt;/p&gt;
&lt;p&gt;sqlservr!MemoryNode::FreePagesInternal&lt;/p&gt;
&lt;p&gt;sqlservr!MemoryClerkInternal::FreePagesInline&lt;/p&gt;
&lt;p&gt;sqlservr!CVarPageMgr::Release&lt;/p&gt;
&lt;p&gt;sqlservr!CMemObj::Free&lt;/p&gt;
&lt;p&gt;sqlservr!CMemThread&amp;lt;CMemObj&amp;gt;::Free&lt;/p&gt;
&lt;p&gt;sqlservr!LockBytesSS::~LockBytesSS&lt;/p&gt;
&lt;p&gt;sqlservr!LockBytesHolder::`scalar deleting destructor'&lt;/p&gt;
&lt;p&gt;sqlservr!LockBytesHolder::DestroyCallback&lt;/p&gt;
&lt;p&gt;sqlservr!CacheLbss&lt;/p&gt;
&lt;p&gt;sqlservr!LockBytesSS::Release&lt;/p&gt;
&lt;p&gt;sqlservr!CQueryIlb::~CQueryIlb&lt;/p&gt;
&lt;p&gt;sqlservr!CBlobHandleFactoryMain::ReleaseILockBytes&lt;/p&gt;
&lt;p&gt;sqlservr!CMainIlb::Release&lt;/p&gt;
&lt;p&gt;sqlservr!CTraceRpcBinaryStream::~CTraceRpcBinaryStream&lt;/p&gt;
&lt;p&gt;sqlservr!CTraceTvpData::~CTraceTvpData&lt;/p&gt;
&lt;p&gt;sqlservr!CRpcTraceHelper::CleanUpTraceTvpData&lt;/p&gt;
&lt;p&gt;sqlservr!CRpcTraceHelper::TracePostExec&lt;/p&gt;
&lt;p&gt;sqlservr!CRPCExecEnv::OnExecFinish&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!endthreadex&lt;/p&gt;
&lt;p&gt;msvcr80!endthreadex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadInitThunk&lt;/p&gt;
&lt;p&gt;ntdll!RtlUserThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2520808" target="_blank"&gt;KB 2520808 FIX: Non-yielding scheduler error when you run a query that uses a TVP in SQL Server 2008 or in SQL Server 2008 R2 if SQL Profiler or SQL Server Extended Events is used&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 13&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CompareStringWEnglishNoCase&lt;/p&gt;
&lt;p&gt;sqlservr!CTypeInfo::ICompW&lt;/p&gt;
&lt;p&gt;sqlservr!CDefaultCollation::ICompW&lt;/p&gt;
&lt;p&gt;sqlservr!CDependElem::ICompare&lt;/p&gt;
&lt;p&gt;sqlservr!CDependList::Find&lt;/p&gt;
&lt;p&gt;sqlservr!CDependList::Insert&lt;/p&gt;
&lt;p&gt;sqlservr!CDependList::Concat&lt;/p&gt;
&lt;p&gt;sqlservr!CDependList::CollectDependencies&lt;/p&gt;
&lt;p&gt;sqlservr!FillSysdepends&lt;/p&gt;
&lt;p&gt;sqlservr!CProchdr::CreateProc&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::PerformPphFakeExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadInitThunk&lt;/p&gt;
&lt;p&gt;ntdll!RtlUserThreadStart&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2306162" target="_blank"&gt;KB 2306162 FIX: Poor performance and some occasional non-yielding scheduler errors occur when you create a complex view that references a large amount of nested views or tables in SQL Server 2008 or in SQL Server 2008 R2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 14&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!BaseSharedHoBt::GetHoBtId&lt;/p&gt;
&lt;p&gt;sqlservr!HoBtFactory::GetDeferredDropCacheHobt&lt;/p&gt;
&lt;p&gt;sqlservr!DropDeferredWorkTables&lt;/p&gt;
&lt;p&gt;sqlservr!GhostRecordCleanupTask&lt;/p&gt;
&lt;p&gt;sqlservr!CGhostCleanupTask::ProcessTskPkt&lt;/p&gt;
&lt;p&gt;sqlservr!TaskReqPktTimer::ExecuteTask&lt;/p&gt;
&lt;p&gt;sqlservr!OnDemandTaskContext::ProcessTskPkt&lt;/p&gt;
&lt;p&gt;sqlservr!SystemTaskContext::ExecuteFunc&lt;/p&gt;
&lt;p&gt;sqlservr!SystemTaskEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!OnDemandTaskContext::FuncEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::FiberEntryPoint&lt;/p&gt;
&lt;p&gt;kernel32!BaseFiberStart&lt;/p&gt;
&lt;p&gt;kernel32!RtlCompareMemoryStub&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2505256" target="_blank"&gt;KB 2505256 FIX: Poor performance when worktables that are marked for deferred drop are cleaned up in SQL Server 2008 R2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 15&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ntdll!ZwReadFile&lt;/p&gt;
&lt;p&gt;kernel32!ReadFile&lt;/p&gt;
&lt;p&gt;sqlservr!DiskReadAsync&lt;/p&gt;
&lt;p&gt;sqlservr!FCB::AsyncRead&lt;/p&gt;
&lt;p&gt;sqlservr!BackupIoRequest::StartDatabaseRead&lt;/p&gt;
&lt;p&gt;sqlservr!BackupCopyMachine::CopyFileToBackupSet0&lt;/p&gt;
&lt;p&gt;sqlservr!BackupCopyMachine::CopyFileToBackupSet&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/960543" target="_blank"&gt;KB 960543 FIX: SQL Server 2005 or SQL Server 2008 may stop responding when you are performing a backup&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 16&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!Worker::ProfilingCPUTicks::ProfilingCpuTicksCallback&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::TaskTransition&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::Switch&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::SuspendNonPreemptive&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::Suspend&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Sleep&lt;/p&gt;
&lt;p&gt;sqlservr!BTreeMgr::Seek&lt;/p&gt;
&lt;p&gt;sqlservr!BTreeMgr::GetHPageIdWithKey&lt;/p&gt;
&lt;p&gt;sqlservr!IndexPageManager::GetPageWithKey&lt;/p&gt;
&lt;p&gt;sqlservr!GetRowForKeyValue&lt;/p&gt;
&lt;p&gt;sqlservr!IndexRowScanner::EstablishInitialKeyOrderPosition&lt;/p&gt;
&lt;p&gt;sqlservr!IndexDataSetSession::GetNextRowValuesInternal&lt;/p&gt;
&lt;p&gt;sqlservr!RowsetNewSS::GetNextRows&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDScan::FGetRow&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDCatalogOwner::GetOwnerAliasIdFromSid&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDCatalogOwner::LookupPrimaryIdInCatalog&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDCacheEntryFactory::GetProxiedCacheEntryByAltKey&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDCatalogOwner::GetProxyOwnerBySID&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDProxyDatabase::GetOwnerBySID&lt;/p&gt;
&lt;p&gt;sqlservr!GetDefaultSchemaIdCrossDb&lt;/p&gt;
&lt;p&gt;sqlservr!GetCtxtSchemaId&lt;/p&gt;
&lt;p&gt;sqlservr!CMEDAccess::GetMultiNameObject&lt;/p&gt;
&lt;p&gt;sqlservr!CRangeObject::CImplName::FSameObject&lt;/p&gt;
&lt;p&gt;sqlservr!CRangeObject::FCheckImplNames&lt;/p&gt;
&lt;p&gt;sqlservr!CRangeObject::XretPostSchemaChecks&lt;/p&gt;
&lt;p&gt;sqlservr!CRangeObject::XretSchemaChanged&lt;/p&gt;
&lt;p&gt;sqlservr!CRangeTable::XretSchemaChanged&lt;/p&gt;
&lt;p&gt;sqlservr!CEnvCollection::XretSchemaChanged&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtQuery::XretSchemaChanged&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtSelect::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretLocalExec&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtExecProc::XretExecExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtExecProc::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2699013" target="_blank"&gt;KB 2699013 FIX: SQL Server 2008 R2 or SQL Server 2008 stops responding and a "Non-yielding Scheduler" error is logged&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration: underline;"&gt;Stack 17&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanNLJoinNew::GetRowHelper&lt;/p&gt;
&lt;p&gt;sqlservr!CQScanNLJoinNew::GetRowHelper&lt;/p&gt;
&lt;p&gt;sqlservr!CQueryScan::GetRow&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtQuery::ErsqExecuteQuery&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtCondWithQuery::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CExecStmtLoopVars::ExecuteXStmtAndSetXretReturn&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,0&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::FExecTrigger&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::FExecAllTriggers&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::XretDMLExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CXStmtDML::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CExecStmtLoopVars::ExecuteXStmtAndSetXretReturn&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;0,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!CStmtPrepQuery::XretExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::ExecuteStmts&amp;lt;1,1&amp;gt;&lt;/p&gt;
&lt;p&gt;sqlservr!CMsqlExecContext::FExecute&lt;/p&gt;
&lt;p&gt;sqlservr!CSQLSource::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!process_request&lt;/p&gt;
&lt;p&gt;sqlservr!process_commands&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Task::Param::Execute&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::RunTask&lt;/p&gt;
&lt;p&gt;sqlservr!SOS_Scheduler::ProcessTasks&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::WorkerEntryPoint&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThread::RunWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SystemThreadDispatcher::ProcessWorker&lt;/p&gt;
&lt;p&gt;sqlservr!SchedulerManager::ThreadEntryPoint&lt;/p&gt;
&lt;p&gt;msvcr80!_callthreadstartex&lt;/p&gt;
&lt;p&gt;msvcr80!_threadstartex&lt;/p&gt;
&lt;p&gt;kernel32!BaseThreadInitThunk&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/967169" target="_blank"&gt;KB 967169 FIX: When you run an UPDATE statement against a table that has a FOR UPDATE trigger that joins the DELETED and INSERTED tables, the query takes a long time to finish&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;Stack 18&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;msvcr80!memcpy&lt;/p&gt;
&lt;p&gt;BackupString::vswcatf&lt;/p&gt;
&lt;p&gt;BackupString::swcatf&lt;/p&gt;
&lt;p&gt;BackupHistory::GenerateBackupDetails&lt;/p&gt;
&lt;p&gt;sqlservr!BackupHistory::GenerateBackupSet&lt;/p&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/917971" target="_blank"&gt;KB 917971 FIX: You may receive more than 100,000 page faults when you try to back up a SQL Server 2005 database that contains hundreds of files and file groups.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Related blogs:&lt;a title="http://mssqlwiki.com/2012/08/17/how-to-analyze-non-yielding-scheduler-dumps/" href="http://mssqlwiki.com/2012/08/17/how-to-analyze-non-yielding-scheduler-dumps/"&gt;http://mssqlwiki.com/2012/08/17/how-to-analyze-non-yielding-scheduler-dumps/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you liked this post, do like us on Facebook at &lt;a href="https://www.facebook.com/mssqlwiki"&gt;https://www.facebook.com/mssqlwiki&lt;/a&gt; and join our Facebook group &lt;a href="https://www.facebook.com/mssqlwiki#!/groups/454762937884205/"&gt;https://www.facebook.com/mssqlwiki#!/groups/454762937884205/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a name="_MailAutoSig"&gt;&lt;/a&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Karthick P.K |Technical Lead | Microsoft SQL Server Support |&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10341905" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="SQLOS" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQLOS/" /><category term="Performance" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Performance/" /><category term="External dump process returned no errors" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/External+dump+process+returned+no+errors/" /><category term="sql scheduler" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+scheduler/" /><category term="SQL Server 2008" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+Server+2008/" /><category term="17888" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/17888/" /><category term="Non-yielding IOCP Listener" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Non_2D00_yielding+IOCP+Listener/" /><category term="Configuration" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Configuration/" /><category term="Stack Dump" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Stack+Dump/" /><category term="non-yielding" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/non_2D00_yielding/" /><category term="SQL Server 2005" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+Server+2005/" /><category term="17887" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/17887/" /><category term="SQL General" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+General/" /><category term="SQLServer dump" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQLServer+dump/" /><category term="Process 0:0:0 ( ) Worker appears to be non-yielding on Scheduler" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Process+0_3A00_0_3A00_0+_2800_+_2900_+Worker+appears+to+be+non_2D00_yielding+on+Scheduler/" /><category term="External dump process returned no errors.DoMiniDump () encountered error" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/External+dump+process+returned+no+errors-DoMiniDump+_28002900_+encountered+error/" /><category term="Debugging" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Debugging/" /><category term="17883" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/17883/" /><category term="memory dump." scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/memory+dump_2E00_/" /><category term="17884" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/17884/" /><category term="SQLServer mdmp" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQLServer+mdmp/" /><category term="SQL Server Engine. Non-yielding Scheduler" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+Server+Engine-+Non_2D00_yielding+Scheduler/" /></entry><entry><title>ASYNC_NETWORK_IO or NETWORK_IO</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/07/27/async-network-io-or-network-io.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/07/27/async-network-io-or-network-io.aspx</id><published>2012-07-27T12:12:00Z</published><updated>2012-07-27T12:12:00Z</updated><content type="html">&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What is ASYNC_NETWORK_IO&amp;#160; or&amp;#160; NETWORK_IO ?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When a query is fired, SQL Server produces the the results ,place it in output buffer and send it to client/Application.    &lt;br /&gt;Client/Application then fetch the result from the Output buffer, process data&amp;#160; and send acknowledgement to SQL Server. If client/Application takes long time to send acknowledgement then SQL Server waits on ASYNC_NETWORK_IO (SQL 2005/2008) or&amp;#160; Network_IO (SQL 2000) before it produces additional results. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Impact of this wait type &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1. SQL Server will not release the locks held by the query unless Acknowledgement is received from Client. Which might cause blocking. &lt;/p&gt;  &lt;p&gt;2. Query duration increases so the query will be slow. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How to troubleshoot ASYNC_NETWORK_IO&amp;#160; or&amp;#160; NETWORK_IO&amp;#160;&amp;#160; wait type? &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Limit the result set: &lt;/strong&gt;Limit the number of rows you fetch from SQL Server. Many application designers fetch the data from whole table with out filtering (Where clause) and do the filtering on client side. This is very wrong approach&amp;#160; there has to be filtering on server side.     &lt;br /&gt;If there is need to fetch huge number of rows from server and if other sessions are experiencing blocking because of ASYNC_NETWORK_IO&amp;#160; or&amp;#160; NETWORK_IO&amp;#160; Then&amp;#160; insert all the rows in to temp table and do the select from temp table.&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Check the performance of client application:&lt;/strong&gt;&amp;#160; Check if client / Application system is experiencing system resource bottleneck. Application will not be able to process the result set faster if there system resource bottleneck &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Network:&lt;/strong&gt; Check the network speed between SQL Server and&amp;#160; Client/Application system. If the network is slow application can not fetch result faster. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;No lock hint or Snapshot isolation level:&lt;/strong&gt; Check if you can use No lock hint or Snapshot isolation level &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Few other SQL Server performance blogs :&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/"&gt;Basics of SQL Server Memory Architecture&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/"&gt;SQL Server I/O Bottlenecks&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.com/sqlwiki/sql-performance/troubleshooting-sql-server-memory/"&gt;Troubleshooting SQL Server Memory&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.com/sqlwiki/sql-server-agent/sql-agent-maxworkerthreads-and-agent-subsystem/"&gt;SQL Agent MaxWorkerThreads and Agent subsystem&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a name="_MailAutoSig"&gt;Thank you,&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Karthick P.K |Technical Lead | Microsoft SQL Server Support | &lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10334184" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="Optimizer" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Optimizer/" /><category term="NETWORK_IO" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/NETWORK_5F00_IO/" /><category term="ASYNC_NETWORK_IO" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/ASYNC_5F00_NETWORK_5F00_IO/" /></entry><entry><title>Unable to open large profiler trace files</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/07/21/my_2D00_c_2D00_drive_2D00_gets_2D00_full_2D00_when_2D00_i_2D00_open_2D00_the_2D00_profiler_2D00_trace.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/07/21/my_2D00_c_2D00_drive_2D00_gets_2D00_full_2D00_when_2D00_i_2D00_open_2D00_the_2D00_profiler_2D00_trace.aspx</id><published>2012-07-22T02:32:17Z</published><updated>2012-07-22T02:32:17Z</updated><content type="html">&lt;p&gt;Profiler filling up space of my system drive…….&lt;/p&gt;  &lt;p&gt;When you run the profiler trace (GUI) or open the saved profiler trace file your System Drive gets out of space&lt;/p&gt;  &lt;p&gt;SQL Server profile uses ‘TMP’ Environment variable for storing the .Trc and trace replay files&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.files.wordpress.com/2011/07/29bc399d487dbb17.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="$29BC399D487DBB17" border="0" alt="$29BC399D487DBB17" src="http://mssqlwiki.files.wordpress.com/2011/07/29bc399d487dbb17_thumb.png" width="414" height="85" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;By default TMP directory points to your system drive, so when we open a large profiler trace file or capture trace in GUI mode system drive gets full.&lt;/p&gt;  &lt;p&gt;We can workaround this by changing the TMP environment variable. Changing TMP environment variable system wide can cause other issues so I would recommend changing TMP temporarily for the process&lt;/p&gt;  &lt;p&gt;1. Open command prompt&lt;/p&gt;  &lt;p&gt;SET TMP=G:\TMP&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.files.wordpress.com/2011/07/130609a642fec889.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="$130609A642FEC889" border="0" alt="$130609A642FEC889" src="http://mssqlwiki.files.wordpress.com/2011/07/130609a642fec889_thumb.png" width="526" height="60" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Open the profiler from command prompt&lt;/p&gt;  &lt;p&gt;&amp;gt;Profiler90.exe&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; --&amp;gt;SQL Server2005&lt;/p&gt;  &lt;p&gt;&amp;gt;Profiler.exe&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; --&amp;gt;SQL Server2008&lt;/p&gt;  &lt;p&gt;&amp;gt;Mysavedtracefile.trc –&amp;gt;Open a saved tracefile&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mssqlwiki.files.wordpress.com/2011/07/4c3bc270a299d0a3.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="$4C3BC270A299D0A3" border="0" alt="$4C3BC270A299D0A3" src="http://mssqlwiki.files.wordpress.com/2011/07/4c3bc270a299d0a3_thumb.png" width="574" height="51" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This would make profiler use G:\TMP&amp;#160; for saving temporary data. So your c:\ would never get full.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a name="_MailAutoSig"&gt;Thank you,&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Karthick P.K |Technical Lead | Microsoft SQL Server Support | &lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10332296" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="Performance" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Performance/" /><category term="Profiler" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Profiler/" /><category term="Trace" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Trace/" /><category term="SQLServer Tools" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQLServer+Tools/" /><category term="profiler trace fills space" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/profiler+trace+fills+space/" /><category term="Drive gets full when I open the profiler trace" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Drive+gets+full+when+I+open+the+profiler+trace/" /></entry><entry><title>Linked server connection fails with “An error occurred during decryption”</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/07/18/linked-server-connection-fails-with-an-error-occurred-during-decryption.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/07/18/linked-server-connection-fails-with-an-error-occurred-during-decryption.aspx</id><published>2012-07-18T18:34:00Z</published><updated>2012-07-18T18:34:00Z</updated><content type="html">&lt;p&gt;&lt;strong&gt;&lt;u&gt;&amp;#160;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&amp;#160;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Problem Description&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;#160;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Linked server connection fails with below error&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)      &lt;br /&gt;——————————       &lt;br /&gt;ADDITIONAL INFORMATION:       &lt;br /&gt;An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)       &lt;br /&gt;——————————       &lt;br /&gt;An error occurred during decryption. (Microsoft SQL Server, Error: 15466)&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Msg 15593, Level 16, State 1, Line 1&lt;/p&gt;    &lt;p&gt;An error occurred while decrypting the password for linked login ‘distributor_admin’ that was encrypted by the old master key. The error was ignored because the FORCE option was specified.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Cause&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;SQL Server service account was changed from services control manager (or) service master key was not backed up and restored when migrating SQL Server to another computer domain.&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms187788.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms187788.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To change the SQL Server service account, use SQL Server Configuration Manager. To manage a change of the service account, SQL Server stores a redundant copy of the service master key protected by the machine account that has the necessary permissions granted to the SQL Server service group. If the computer is rebuilt, the same domain user that was previously used by the service account can recover the service master key. This does not work with local accounts or the Local System, Local Service, or Network Service accounts. When you are moving SQL Server to another computer, migrate the service master key by using backup and restore.&lt;/p&gt;  &lt;p&gt;The REGENERATE phrase regenerates the service master key. When the service master key is regenerated, SQL Server decrypts all the keys that have been encrypted with it, and then encrypts them with the new service master key. This is a resource-intensive operation. You should schedule this operation during a period of low demand, unless the key has been compromised. If any one of the decryptions fail, the whole statement fails.&lt;/p&gt;  &lt;p&gt;The FORCE option causes the key regeneration process to continue even if the process cannot retrieve the current master key, or cannot decrypt all the private keys that are encrypted with it. Use FORCE only if regeneration fails and you cannot restore the service master key by using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms187972.aspx"&gt;RESTORE SERVICE MASTER KEY&lt;/a&gt; statement.&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Resolution&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Regenerate the service master key using &lt;strong&gt;ALTER SERVICE MASTER KEY REGENERATE&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you receive the following error message when running &lt;strong&gt;ALTER SERVICE MASTER KEY REGENERATE.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;The current master key cannot be decrypted. If this is a database master key, you should attempt to open it in the session before performing this operation. The FORCE option can be used to ignore this error and continue the operation but the data encrypted by the old master key will be lost.&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;We are left with only option to &lt;strong&gt;force&lt;/strong&gt; regenerating service master key using “&lt;strong&gt;ALTER SERVICE MASTER KEY FORCE REGENERATE&lt;/strong&gt; “. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;The service master key is the root of the SQL Server encryption hierarchy. The service master key directly or indirectly protects all other keys and secrets in the tree. If a dependent key cannot be decrypted during a forced regeneration, the data the key secures will be lost. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you liked this post, do like us on FaceBook at &lt;a href="https://www.facebook.com/mssqlwiki"&gt;https://www.facebook.com/mssqlwiki&lt;/a&gt; and join our FaceBook group &lt;a href="https://www.facebook.com/mssqlwiki#!/groups/454762937884205/"&gt;https://www.facebook.com/mssqlwiki#!/groups/454762937884205/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a name="_MailAutoSig"&gt;Thank you,&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Karthick P.K |Technical Lead | Microsoft SQL Server Support | E-mail: &lt;a href="mailto:karthick.krishnamurthy@microsoft.com"&gt;karthick.krishnamurthy@microsoft.com&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10331301" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="Connectivity" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Connectivity/" /><category term="Security" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Security/" /><category term="Linked server" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Linked+server/" /><category term="An error occurred while decrypting the password for linked login ‘distributor_admin’ that was encrypted by the old master key. The error was ignored because the FORCE option was specified." scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/An+error+occurred+while+decrypting+the+password+for+linked+login+_1820_distributor_5F00_admin_1920_+that+was+encrypted+by+the+old+master+key-+The+error+was+ignored+because+the+FORCE+option+was+specified_2E00_/" /><category term="Line 1" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Line+1/" /><category term="State 1" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/State+1/" /><category term="An error occurred during decryption. (Microsoft SQL Server" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/An+error+occurred+during+decryption-+_2800_Microsoft+SQL+Server/" /><category term="Msg 15593" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Msg+15593/" /><category term="Error: 15466)" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Error_3A00_+15466_2900_/" /><category term="Level 16" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Level+16/" /></entry><entry><title>The process cannot access the file 'C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll' because it is being used by another process.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/07/16/the-process-cannot-access-the-file-c-windows-system32-perf-mssql10-50-mssqlserver-sqlagtctr-dll-because-it-is-being-used-by-another-process.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/07/16/the-process-cannot-access-the-file-c-windows-system32-perf-mssql10-50-mssqlserver-sqlagtctr-dll-because-it-is-being-used-by-another-process.aspx</id><published>2012-07-16T18:11:00Z</published><updated>2012-07-16T18:11:00Z</updated><content type="html">&lt;p&gt;&lt;font size="2" face="Verdana"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;SQL Server CU’s update fails with error &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;“&lt;/font&gt;&lt;font size="4"&gt;&lt;strong&gt;ScoException: The process cannot access the file 'C:\Windows\system32\&lt;font color="#ff0000"&gt;perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll'&lt;/font&gt; because it is being used by another process.&lt;/strong&gt; ---&amp;gt;&lt;/font&gt; System.IO.IOException: The process cannot access the file 'C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll' because it is being used by another process.    &lt;br /&gt;&lt;font size="2" face="Verdana"&gt; ”&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;&lt;strong&gt;In Detail.txt you will find errors like one listed below&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;Sco: Attempting to normalize directory path 'C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll'     &lt;br /&gt;Error: Action &amp;quot;Microsoft.SqlServer.Configuration.ScoExtension.VerifiedCopyFileAction&amp;quot; threw an exception during execution.      &lt;br /&gt;Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: File C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\DllTmp64\sqlagentctr100.dll could not be copied to file path C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll. ---&amp;gt; Microsoft.SqlServer.Configuration.ScoExtension.CopyFileException: File C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\DllTmp64\sqlagentctr100.dll could not be copied to file path C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll. ---&amp;gt; Microsoft.SqlServer.Configuration.Sco.&lt;font size="4"&gt;&lt;strong&gt;ScoException: The process cannot access the file 'C:\Windows\system32\&lt;font color="#ff0000"&gt;perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll'&lt;/font&gt; because it is being used by another process.&lt;/strong&gt; ---&amp;gt;&lt;/font&gt; System.IO.IOException: The process cannot access the file 'C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll' because it is being used by another process.      &lt;br /&gt;&amp;#160;&amp;#160; at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)      &lt;br /&gt;&amp;#160;&amp;#160; at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)      &lt;br /&gt;&amp;#160;&amp;#160; at Microsoft.SqlServer.Configuration.Sco.SqlFile.CopyTo(String targetFileFullPath, Boolean bCopyAcl)      &lt;br /&gt;&amp;#160;&amp;#160; --- End of inner exception stack trace ---      &lt;br /&gt;tion, ActionMetadata actionMetadata, TextWriter statusStream)      &lt;br /&gt;Slp:&amp;#160;&amp;#160;&amp;#160; at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction(WorkflowObject metabase, TextWriter statusStream)      &lt;br /&gt;Slp:&amp;#160;&amp;#160;&amp;#160; at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)      &lt;br /&gt;Slp: The configuration failure category of current exception is ConfigurationFailure      &lt;br /&gt;Slp: Watson Bucket 1       &lt;br /&gt; Original Parameter Values &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 0 : SQL2008@RTM@KB2703282 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 1 : Microsoft.SqlServer.Configuration.ScoExtension.VerifiedCopyFileAction.ExecuteAction &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 2 : System.IO.__Error.WinIOError &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 3 : Microsoft.SqlServer.Configuration.ScoExtension.CopyFileException@1360@3 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 4 : System.IO.IOException@-2147024864 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 5 : CopyPerfCounterDllToSystemDir &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 7 : Microsoft.SqlServer.Configuration.ScoExtension.CopyFileException@CopyFileFailed &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 8 : sqlagentctr100.dll &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp:      &lt;br /&gt; Final Parameter Values &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 0 : SQL2008@RTM@KB2703282 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 1 : 0x31492EED &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 2 : 0x60797DC7 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 3 : 0xFDBE3E6D@1360@3 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 4 : 0x24C2C4E7 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 5 : CopyPerfCounterDllToSystemDir &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 7 : 0xCDC6E6DD &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;2012-07-25 11:01:36 Slp: Parameter 8 : 0xDD73CFED &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Verdana"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="3" face="Verdana"&gt;&lt;strong&gt;&lt;u&gt;Resolution:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3"&gt;Rename C:\Windows\system32\perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll and Re-run the setup. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000" size="3"&gt;Note: Name of the above mentioned file would change based on the instance name. so review the detail.txt to get the correct file name,rename it and then re-run the setup.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;&amp;#160;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;font size="3" face="Verdana"&gt;Similar SQL Server setup issues&lt;/font&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2012/07/18/service-pack-hotfix-and-cu-installation-for-sql-server-2005-might-fail-with-unable-to-install-windows-installer-msi-file/"&gt;Service pack ,Hotfix and CU installation for SQL Server might fail with “Unable to install Windows Installer MSI file“&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2011/01/12/a-failure-was-detected-for-a-previous-installation-patch-or-repair-during-configuration-for-features-sql_powershell_engine_cnssql_powershell_tools_ans-in-order-to-apply-this-patch-package-kb968/"&gt;A failure was detected for a previous installation, patch, or repair during configuration for features [SQL_PowerShell_Engine_CNS,SQL_PowerShell_Tools_ANS]. In order to apply this patch package (KB968369), you must resolve any issues with the previous operation that failed.&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2010/11/17/sqlserver2008-script-level-upgrade-for-database-master-failed-because-upgrade-step-sqlagent100_msdb_upgrade-sql-encountered-error-574-state-0-severity-16/"&gt;SQLServer2008: Script level upgrade for database ‘master’ failed because upgrade step ‘sqlagent100_msdb_upgrade.sql’ encountered error 574, state 0, severity 16&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2009/03/26/installation-of-sqlserver2008-cluster-fails-on-windows2008-the-group-or-resource-is-not-in-the-correct-state-to-perform-the-requested-operation-exception-from-hresult-0x8007139f/"&gt;Installation of SQLserver2008 cluster fails on windows2008.(The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2010/10/29/sqlserver-2008-fails-to-come-online-on-cluster-after-upgrade/"&gt;SQLServer 2008 Fails to come online on cluster after upgrade&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2009/03/26/installation-of-sqlserver20052008-fails-on-windows2008-cluster/"&gt;Installation of SQLServer2005/2008 Fails on Windows2008 Cluster.&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;h4&gt;&lt;a href="http://mssqlwiki.com/2009/01/14/unable-to-start-sqlserver-agent-resource-on-cluster-after-upgrading-to-9-00-3186-or-higher/"&gt;Unable to start SQLServer agent resource on cluster after upgrading to 9.00.3186 or Higher&lt;/a&gt;&lt;/h4&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a name="_MailAutoSig"&gt;Thank you,&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Karthick P.K |Technical Lead | Microsoft SQL Server Support |&lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10334294" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="SQL Server setup" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+Server+setup/" /><category term="The process cannot access the file" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/The+process+cannot+access+the+file/" /><category term="perf-MSSQL10_50.MSSQLSERVER-sqlagtctr.dll" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/perf_2D00_MSSQL10_5F00_50-MSSQLSERVER_2D00_sqlagtctr-dll/" /><category term="CopyPerfCounterDllToSystemDir" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/CopyPerfCounterDllToSystemDir/" /></entry><entry><title>I/O requests taking longer than 15 seconds to complete on file</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/06/26/io_2D00_bottlenecks.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/06/26/io_2D00_bottlenecks.aspx</id><published>2012-06-26T15:23:00Z</published><updated>2012-06-26T15:23:00Z</updated><content type="html">&lt;p style="text-align: justify"&gt;&lt;span style="text-decoration: underline"&gt;&lt;strong&gt;SQL Server I/O Bottlenecks ( I/O requests taking longer than 15 seconds to complete on file )&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;span style="text-decoration: underline"&gt;&lt;strong&gt;&amp;#160;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;New version of this post in available in &lt;a href="http://mssqlwiki.com/2012/08/27/io-requests-taking-longer-than-15-seconds-to-complete-on-file/" target="_blank"&gt;&lt;font size="3"&gt;&lt;strong&gt;This link&lt;/strong&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;Do you see warnings like one below in your SQL Server error log?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: #ff0000"&gt;SQL Server has encountered&amp;#160; x occurrence(s) of I/O requests taking longer than 15 seconds to complete on file . &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: #ff0000"&gt;The OS file handle is 0x000006A4. The offset of the latest long I/O is: 0x00000&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;span style="text-decoration: underline"&gt;&lt;strong&gt;This indicates &lt;span style="text-decoration: underline"&gt;SQL Server I/O Bottlenecks. &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;SQL Server performance highly relies on the Disk performance.&amp;#160; SQL Server I/O Bottleneck can be identified through&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;1. PAGEIOLATCH_xx or WRITELOG wait types in Sys.Sysprocesses and other DMV's&lt;/p&gt;  &lt;p style="text-align: justify"&gt;2. I/O taking longer than 15 seconds in SQL Server Error log.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;{&lt;/p&gt;  &lt;p&gt;SQL Server has encountered X occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [ ] in database [IOTEST (7). The OS file handle is 0x000006A4. The offset of the latest long I/O is:   &lt;br /&gt;0x000001&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p style="text-align: justify"&gt;3. By looking at I/O latch wait statistics in sys.dm_os_wait_stats&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;Select&amp;#160; wait_type,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; waiting_tasks_count,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; wait_time_ms&amp;#160; from&amp;#160;&amp;#160;&amp;#160; sys.dm_os_wait_stats where&amp;#160;&amp;#160;&amp;#160; wait_type like 'PAGEIOLATCH%'   &lt;br /&gt;order by wait_type&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p style="text-align: justify"&gt;4. By looking at pending I/O requests and isolating the disks,File and database in which we have I/O Bottleneck.&lt;/p&gt;  &lt;p&gt;{&lt;/p&gt;  &lt;p&gt;select&amp;#160;&amp;#160;&amp;#160;&amp;#160; database_id,&amp;#160;&amp;#160;&amp;#160;&amp;#160; file_id,&amp;#160;&amp;#160;&amp;#160;&amp;#160; io_stall,&amp;#160;&amp;#160;&amp;#160;&amp;#160; io_pending_ms_ticks,&amp;#160;&amp;#160;&amp;#160;&amp;#160; scheduler_address from&amp;#160;&amp;#160;&amp;#160; sys.dm_io_virtual_file_stats(NULL, NULL)t1,&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sys.dm_io_pending_io_requests as t2   &lt;br /&gt;where&amp;#160;&amp;#160;&amp;#160; t1.file_handle = t2.io_handle&lt;/p&gt;  &lt;p&gt;}&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: small"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline"&gt;&lt;span style="color: #0000ff; font-size: small"&gt;Following are common reasons for I/O Bottleneck in SQL Server.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;1. SQL Server is spawning more I/O requests than what I/O disk subsystem could handle.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;2 . There could be an Issue with I/O subsystem (or) driver/firmware issue (or) Misconfiguration in I/O Subsystem (or) Compression and&amp;#160; so the Disks are performing very slow and hence SQL Server is affected.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;3. Some other process on the system is saturating the disks with I/O requests. Common application includes AV Scan,System Backup Etc. So I/O requests posted by SQL Server becomes slow.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;&lt;span style="color: #0000ff; font-size: small"&gt;&lt;span style="text-decoration: underline"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;&lt;span style="color: #0000ff; font-size: small"&gt;&lt;span style="text-decoration: underline"&gt;How to&amp;#160; troubleshoot?&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;1.&amp;#160; Exclude SQL Server files from antivirus scan.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;2. Do not place SQL Server FILES on compressed drives.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;3. Distribute SQL Server data files and transaction log files across drives.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;4. If the “I/O request taking longer” warning is for tempdb , Enable trace flag 1118 and increase the tempdb data files refer:&lt;a title="http://support.microsoft.com/kb/2154845" href="http://support.microsoft.com/kb/2154845"&gt;http://support.microsoft.com/kb/2154845&lt;/a&gt;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;5. If none of the above resolves the issue collect the below perfmon counters. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;Perfmon counters can help us in understanding “If disk is slow” or&amp;#160; “SQL Server is spawning more I/O then what disk could handle” or “Some other process is saturating disk with I/O”&lt;/p&gt;  &lt;p style="text-align: justify"&gt;Note:It is important to get&amp;#160; throughput of the disk subsystem in MB/SEC before we look at disk counters. Normally it will be more than 150 MB for SAN disk and greater 50 MB for Single disk .When you look at the perfmon counter look at Max value.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Avg. Disk sec/Transfer&lt;/strong&gt; --&amp;gt; Time taken to perform the I/O operation&lt;/p&gt;  &lt;p&gt;Ideal value for &lt;strong&gt;Disk sec/Transfer&lt;/strong&gt; is 0.005-0.010 sec. If you consistently notice this counter is beyond 0.015 then there is a serious I/O bottleneck. &lt;/p&gt;  &lt;p&gt;1. Look for Disk Bytes /sec when &lt;strong&gt;Avg. Disk sec/Transfer&lt;/strong&gt;&amp;#160; is greater than 0.015. If it is below 200 MB for SAN disk and Below 50 MB for Single disk then the problem is with I/O subsystem Engage hardware vendor.&lt;/p&gt;  &lt;p&gt;2. If the Disk Bytes /sec&amp;#160; is greater than&amp;#160; 200 MB for SAN disk or greater than 50 MB for Single disk when the&amp;#160; &lt;strong&gt;Avg. Disk sec/Transfer&lt;/strong&gt;&amp;#160; is greater than 0.015. Look at the &lt;strong&gt;Process:IO Data Bytes/Sec &lt;/strong&gt;for the same time and identify which process is spawning I/O. If the identified process is not SQL Server involve the team which supports that process. If the&amp;#160; the identified process is SQL Server tune SQL Server queries which are I/O intensive by creating dropping indexes etc.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;Disk Bytes /sec&amp;#160; &lt;/strong&gt; --&amp;gt; Total read and write to disk per second in bytes. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Collect the values for each logical disks in which SQL Server files are placed and look at the Max value for this counter ideally it has to be greater than the throughput of the disk subsystem. If you don’t have the throughput for the disk then this value to be greater than 200MB for SAN or greater than 50 MB for single disk. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;If it is below the expected value you can consider that your disks are not performing well. Involve the hardware vendor.&amp;#160; &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Important: Value for this counter will be low when there is no I/O happening on the drives. So you have to look at the this counter during the time you see I/O warnings or When Disk sec/Transfer &amp;gt;0.010 for the same drive.&amp;#160; &lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;Process:IO Data Bytes/Sec&lt;/strong&gt; --&amp;gt; Total read and write to disk per second in bytes by each process.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;Collect this counter for all the processes running on the server. This counter will help us understand if any other process is saturating the disk with excessive I/O. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Example: Let us consider a disk with max throughput of 250MB per second. If antivirus is spawning 200MB of I/O per second and if SQL Server data files are placed in same drive and SQL Server is spawning 150MB obviously there will be I/O waits.&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="text-align: justify"&gt;&lt;strong&gt;Buffer Manager: Page Read/sec + Page Writes/sec&lt;/strong&gt; --&amp;gt;Total read and write to disk per second in bytes by SQL Server process.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

&lt;p&gt;If (Disk sec/Transfer &amp;gt; ==0.015 Consistently) and ( (Disk Bytes /sec &amp;lt; 150MB (For San)) or (Disk Bytes /sec &amp;lt; 50MB (For Local) or (Disk Bytes /sec &amp;lt; Speed of disk as per Vendor ))&lt;/p&gt;

&lt;p&gt;{&lt;/p&gt;

&lt;p&gt;There is Issue with I/O subsystem (or) driver/firmware issue (or) Misconfiguration in I/O Subsystem.&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;If (Disk sec/Transfer &amp;gt; ==0.015 Consistently) and ( (Disk Bytes /sec &amp;gt;= 150 (For San)) or (Disk Bytes /sec &amp;gt;= 50MB (For Local) or (Disk Bytes /sec &amp;gt;= Speed of disk as per Vendor ))&lt;/p&gt;

&lt;p&gt;{&lt;/p&gt;

&lt;p&gt;Identify the process which is posting excessive I/O request using Process:IO Data Bytes/Sec.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;If ( Identified process == SQLServer.exe )&lt;/p&gt;

  &lt;p&gt;{&lt;/p&gt;

  &lt;p&gt;Identify and tune the queries which is Spawning excessive I/O.&lt;/p&gt;

  &lt;p&gt;(Reads+Writes column in profiler, Dashboard reports or sys.dm_exec_query_stats and sys.dm_exec_sql_text&lt;/p&gt;

  &lt;p&gt;can be used to identify the query). Use DTA to tune the query&lt;/p&gt;

  &lt;p&gt;}&lt;/p&gt;

  &lt;p&gt;If ( Identified process != SQLServer.exe )&lt;/p&gt;

  &lt;p&gt;{&lt;/p&gt;

  &lt;p&gt;Engage the owner of application which is spawning excessive I/O&lt;/p&gt;

  &lt;p&gt;}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Many thanks to &lt;strong&gt;Joseph Pilov&lt;/strong&gt; from whom I learned many techniques like the one above. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;If you liked this post, do like us on FaceBook at &lt;a href="https://www.facebook.com/mssqlwiki"&gt;https://www.facebook.com/mssqlwiki&lt;/a&gt; and join our FaceBook group &lt;a href="https://www.facebook.com/mssqlwiki#!/groups/454762937884205/"&gt;https://www.facebook.com/mssqlwiki#!/groups/454762937884205/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a name="_MailAutoSig"&gt;&lt;/a&gt;Thank you,&lt;/p&gt;

&lt;p&gt;Karthick P.K&amp;#160; |&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10324016" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="sql server performance" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+performance/" /><category term="I/O requests taking longer than 15 seconds to complete on file" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/I_2F00_O+requests+taking+longer+than+15+seconds+to+complete+on+file/" /><category term="PAGEIOLATCH" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/PAGEIOLATCH/" /><category term="Troubleshooting SQL Server I/O" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Troubleshooting+SQL+Server+I_2F00_O/" /><category term="sql server disk io" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+disk+io/" /><category term="SQL Server has encountered NN occurrence" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/SQL+Server+has+encountered+NN+occurrence/" /></entry><entry><title>A significant part of SQL Server process memory has been paged out</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/06/22/a-significant-part-of-sql-server-process-memory-has-been-paged-out.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/06/22/a-significant-part-of-sql-server-process-memory-has-been-paged-out.aspx</id><published>2012-06-22T19:39:00Z</published><updated>2012-06-22T19:39:00Z</updated><content type="html">&lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size: 10pt" color="#ff0000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&lt;/span&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;A newer version of this post is available in &lt;font size="4"&gt;&lt;a href="http://mssqlwiki.com/2012/06/27/a-significant-part-of-sql-server-process-memory-has-been-paged-out/" target="_blank"&gt;&lt;strong&gt;THIS LINK&lt;/strong&gt;&lt;/a&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;span style="mso-ansi-language: en" lang="EN"&gt;&amp;#160;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;A significant part of SQL Server process memory has been paged out. This may result in performance degradation.&lt;/p&gt;  &lt;p&gt;A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 2007640, committed (KB): 4594040, memory utilization: 43%.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What is working set:&lt;/strong&gt; Memory allocated by the process which is currently in RAM.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Committed: &lt;/strong&gt;Total memory that is allocated by process (allocated bytes can be in RAM or Page file)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Working Set trimming:&lt;/strong&gt;&amp;#160; Windows is moving the allocated bytes of the process from physical RAM to page file because of memory pressure. Memory pressure is most commonly caused by applications or windows components that are requesting more memory causing OS to start trimming working set of other processes to satisfy these new requests.&lt;/p&gt;  &lt;p&gt;Before we step in to troubleshooting working set trimming warnings, here are few basics about how SQL Server memory management is designed to dynamically adjust the committed memory based on the amount of available memory on the system. &lt;/p&gt;  &lt;p&gt;SQL Server uses CreateMemoryResourceNotification to create a memory resource notification object&amp;#160; and SQL Server Resource monitor threads calls QueryMemoryResourceNotification every time it runs to identify if there is any notification. If a low memory notification comes from Windows, SQL Server scales down its memory usage and when Windows sends the high memory notification, SQL Server Server can grow its memory usage target. Low memory notification is signaled by windows when the available physical memory drops approximately below 32 MB per 4 GB, to a maximum of 64 MB. The default level that signals a high-memory-resource notification event is three times the default low-memory value. As soon as the SQL Server resource monitor threads finds low-memory-resource notification it scales down SQL Server memory usage.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why do I see “&lt;/strong&gt;&lt;strong&gt;A significant part of sql server process memory has been paged out. This may result in performance degradation.” By SQL Server In spite of having above mechanism to detect the system level memory pressure and scale SQL Server memory? &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There are couple of situations where SQL Server Process working set might be paged out by Windows despite these memory resource notification mechanism.&lt;/p&gt;  &lt;p&gt;1.If windows is not sending the correct notifications to all listening processes at the right moment and thresholds&lt;/p&gt;  &lt;p&gt;2.If SQL Server is not responding fast enough to the low memory resource notification from Windows&lt;/p&gt;  &lt;p&gt;3.Conditions in Windows where working sets of all processes are trimmed&lt;/p&gt;  &lt;p&gt;4.Windows might decide to trim a certain percentage of working set of various or specific processes&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;We can also increase the LowMemoryThreshold value so the OS will notify applications such as SQL on low memory conditions much earlier and SQL Server can respond to memory pressure much early before the system is starving for memory.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;How to set the LowMemoryThreshold value (in MB)?&lt;/p&gt;  &lt;p&gt;In Regedit -&amp;gt; go to&lt;/p&gt;  &lt;p&gt;HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\MemoryManagement&lt;/p&gt;  &lt;p&gt;Right click on the right pane, &lt;/p&gt;  &lt;p&gt;Select New -&amp;gt; select click DWORD Value -&amp;gt; enter LowMemoryThreshold&lt;/p&gt;  &lt;p&gt;Double Click LowMemoryThreshold -&amp;gt; value (choose decimal) -&amp;gt; 1000&lt;/p&gt;  &lt;p&gt;System Reboot is required to take effect.&lt;/p&gt;  &lt;p&gt;Default values as per MSDN: &lt;/p&gt;  &lt;p&gt;“The default level of available memory that signals a low-memory-resource notification event is approximately 32 MB per 4 GB, to a maximum of 64 MB. The default level that signals a high-memory-resource notification event is three times the default low-memory value.”&lt;/p&gt;  &lt;p&gt;We can use the below query to extract information about the condition of OS memory and SQL memory using a query like the following. Looking at this query, you will be able to easily determine the various indicators that would have triggered the Windows to page various processes including SQL Server. Use the following query to obtain the memory notification-related information from the XML data of the ring buffer&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;SELECT &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;CONVERT (varchar(30), GETDATE(), 121) as runtime,&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;DATEADD (ms, a.[Record Time] - sys.ms_ticks, GETDATE()) AS Notification_time,&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;a.* ,&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;sys.ms_ticks AS [Current Time]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;FROM &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;(SELECT x.value('(//Record/ResourceMonitor/Notification)[1]', 'varchar(30)') AS [Notification_type], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/MemoryUtilization)[1]', 'int') AS [MemoryUtilization %], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/TotalPhysicalMemory)[1]', 'bigint') AS [TotalPhysicalMemory_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/AvailablePhysicalMemory)[1]', 'bigint') AS [AvailablePhysicalMemory_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/TotalPageFile)[1]', 'bigint') AS [TotalPageFile_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/AvailablePageFile)[1]', 'bigint') AS [AvailablePageFile_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/TotalVirtualAddressSpace)[1]', 'bigint') AS [TotalVirtualAddressSpace_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryRecord/AvailableVirtualAddressSpace)[1]', 'bigint') AS [AvailableVirtualAddressSpace_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryNode/@id)[1]', 'int') AS [Node Id], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryNode/ReservedMemory)[1]', 'bigint') AS [SQL_ReservedMemory_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/MemoryNode/CommittedMemory)[1]', 'bigint') AS [SQL_CommittedMemory_KB], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/@id)[1]', 'bigint') AS [Record Id], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/@type)[1]', 'varchar(30)') AS [Type], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/ResourceMonitor/Indicators)[1]', 'int') AS [Indicators], &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;x.value('(//Record/@time)[1]', 'bigint') AS [Record Time]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;FROM (SELECT CAST (record as xml) FROM sys.dm_os_ring_buffers &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;WHERE ring_buffer_type = 'RING_BUFFER_RESOURCE_MONITOR') AS R(x)) a &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;CROSS JOIN sys.dm_os_sys_info sys&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;ORDER BY DATEADD (ms, a.[Record Time] - sys.ms_ticks, GETDATE())&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size: 11pt" color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Common Side Effects of Working set Trimming&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1.&amp;#160; When OS starts trimming the working set of SQL Server we normally see non-yielding Resource Monitor dumps.&lt;/p&gt;  &lt;p&gt;2.&amp;#160; IS-alive check failures resulting in SQL Server resource failure.&lt;/p&gt;  &lt;p&gt;3. Resource monitor thread can start&amp;#160; Garbage collector&amp;#160; if SQLCLR is enabled on this instance of SQL. When Garbage collector&amp;#160; is kicked off during memory pressure all other threads in the process are suspended. So if Garbage collector is taking a long time reosurce monitor thread appears stuck and hence the non-yielding errors and dumps are generated. (Refer &lt;a href="http://support.microsoft.com/kb/2504603"&gt;http://support.microsoft.com/kb/2504603&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How to troubleshoot?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1.&amp;#160; Capture perfmon counters (Process: Private bytes and Working set ) to determine which applications / windows component are requesting memory and causing OS to start trimming the working set of processes including SQL Server.&lt;/p&gt;  &lt;p&gt;2.&amp;#160; Use &lt;a href="https://skydrive.live.com/redir?resid=AA1F36752D8FDBF!351&amp;amp;authkey=!AN3zL3hVh89miK8"&gt;&lt;strong&gt;This&lt;/strong&gt;&lt;/a&gt; exe which will print the memory information of all the processes and system wide memory information (Global memory status) when the operating system signals&amp;#160; low memory notification.&lt;/p&gt;  &lt;p&gt;3.&amp;#160; Cap the SQL Server MAX Server Memory after considering the memory required by other applications, Operating system, Drivers , SQL Server Non- Bpool allocations etc. Make sure you have adequate available physical memory even when the system is under heavy load.&lt;/p&gt;  &lt;p&gt;4.&amp;#160; We can consider using the Lock pages in memory privilege. Remember it protects only the BPool from paging and Non-Bpool allocations can still be paged out.&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000" face="Calibri"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000" face="Calibri"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000" face="Calibri"&gt;&amp;#160;&lt;/font&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/" href="http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/&lt;/a&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/windows-2008-and-windows-2008-r2-known-issues-related-to-working-set-memory/" href="http://mssqlwiki.com/sqlwiki/sql-performance/windows-2008-and-windows-2008-r2-known-issues-related-to-working-set-memory/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/windows-2008-and-windows-2008-r2-known-issues-related-to-working-set-memory/&lt;/a&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;a title="http://mssqlwiki.com/2012/05/18/sql-server-performance-degraded-in-32-bit-sql-server-after-i-adding-additional-ram/" href="http://mssqlwiki.com/2012/05/18/sql-server-performance-degraded-in-32-bit-sql-server-after-i-adding-additional-ram/"&gt;http://mssqlwiki.com/2012/05/18/sql-server-performance-degraded-in-32-bit-sql-server-after-i-adding-additional-ram/&lt;/a&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/troubleshooting-sql-server-memory/" href="http://mssqlwiki.com/sqlwiki/sql-performance/troubleshooting-sql-server-memory/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/troubleshooting-sql-server-memory/&lt;/a&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/" href="http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/&lt;/a&gt;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&amp;#160;&lt;/p&gt;  &lt;p style="list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you liked this post, do like us on FaceBook at &lt;a href="https://www.facebook.com/mssqlwiki"&gt;https://www.facebook.com/mssqlwiki&lt;/a&gt; and join our FaceBook group &lt;a href="https://www.facebook.com/mssqlwiki#!/groups/454762937884205/"&gt;https://www.facebook.com/mssqlwiki#!/groups/454762937884205/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thank you,&lt;/p&gt;  &lt;p&gt;Karthick P.K |&lt;a href="https://www.facebook.com/groups/454762937884205/"&gt;My Facebook Page&lt;/a&gt; |&lt;a href="http://mssqlwiki.com/"&gt;My Site&lt;/a&gt;| &lt;a href="http://blogs.msdn.com/b/karthick_pk/"&gt;Blog space&lt;/a&gt;| &lt;a href="https://twitter.com/mssqlwiki"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10323107" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="sql server performance" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+performance/" /><category term=". This may result in a performance degradation" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/-+This+may+result+in+a+performance+degradation/" /><category term="Locked pages in memory" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Locked+pages+in+memory/" /><category term="Working settrim" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Working+settrim/" /></entry><entry><title>Troubleshooting SQL Server Memory</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/karthick_pk/archive/2012/06/15/troubleshooting-sql-server-memory.aspx" /><id>http://blogs.msdn.com/b/karthick_pk/archive/2012/06/15/troubleshooting-sql-server-memory.aspx</id><published>2012-06-15T15:39:00Z</published><updated>2012-06-15T15:39:00Z</updated><content type="html">&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;First step to troubleshoot SQL Server memory is to identify whether the whether the low memory condition appears to be in MemToLeave, or in the BPool.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-size: 10pt;"&gt;Note: If you do not know what is BPOOL or MemToLeave. Please read &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;&lt;a style="cursor: auto;" href="https://mssqlwiki.wordpress.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/" target="_blank"&gt;&lt;span&gt;&lt;span style="color: #800080;"&gt;&lt;span style="text-decoration: underline;"&gt;SQL Server Memory architecture&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #000000;"&gt; before troubleshooting SQL Server memory. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Newer version of this post is available in &lt;a href="http://mssqlwiki.com/sqlwiki/sql-performance/troubleshooting-sql-server-memory/"&gt;&lt;strong&gt;&lt;span style="font-size: medium;"&gt;This&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt; link.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;MemToLeave errors: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;SQL Server 2000&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WARNING: Failed to reserve contiguous memory of Size= 65536. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WARNING: Clearing procedure cache to free contiguous memory. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17802 "Could not create server event thread." &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL Server could not spawn process_loginread thread.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;SQL Server 2005/2008 &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Failed Virtual Allocate Bytes: FAIL_VIRTUAL_RESERVE 122880&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-size: 10pt;"&gt;Buffer Pool errors: &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;BPool::Map: no remappable address found.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BufferPool out of memory condition&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-size: 10pt;"&gt;Either BPool (or) MemToLeave&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;strong&gt;&lt;span style="color: #000000;"&gt;errors: &lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error: 17803 &amp;ldquo;Insufficient memory available..&amp;rdquo;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Buffer Distribution:&amp;nbsp; Stolen=7901 Free=0 Procedures=1 Inram=201842 Dirty=0 Kept=572&amp;hellip;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000;"&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;Error: 701, Severity: 17, State: 123. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; There is insufficient system memory to run this query.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="font-size: 10pt;"&gt;Working set trim and page out&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;A significant part of SQL Server process memory has been paged out. This may result in performance degradation. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 2007640, committed (KB): 4594040, memory utilization: 43%. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000;"&gt;&lt;span style="font-size: 10pt;"&gt;Jump&amp;nbsp; to&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;a style="cursor: auto;" href="http://mssqlwiki.com/2012/06/27/a-significant-part-of-sql-server-process-memory-has-been-paged-out/"&gt;&lt;span&gt;&lt;span style="color: #800080; font-size: 10pt;"&gt;&lt;span style="text-decoration: underline;"&gt;A significant part of SQL Server process memory has been paged out&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Section 1 (MTL error):&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span&gt;&lt;span style="color: #000000;"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt;"&gt;If the Problem is with MTL we have to determine&amp;nbsp; whether it is SQL Server or some non-SQL component that is using the most MemToLeave memory (Remember what is in MTL? section in &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;&lt;a style="cursor: auto;" href="https://mssqlwiki.wordpress.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/" target="_blank"&gt;&lt;span&gt;&lt;span style="color: #800080;"&gt;&lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;SQL Server Memory architecture&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt; ) . &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;SQL Server 2000: OS Reserved and OS Committed counters in the DBCC memory status output will tell us how many pages SQL Server itself is using in MTL. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;br /&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Note: Each page is 8192&amp;nbsp; bytes so Multiply OS Committed * 8192 bytes /1024 to get value in MB. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;SQLServer2005/2008:&amp;nbsp; Capture sum of MultiPage Allocator for all nodes (Memory node Id = 0,1..n)from DBCC memorystatus output printed immediately after OOM errors in SQL Server errorlog.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;This will tell us how many KB SQL Server itself is using in MTL.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;You can also take the sum of&amp;nbsp; multi_pages_kb from sys.dm_os_memory_clerks&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;select sum(multi_pages_kb)&amp;nbsp; from sys.dm_os_memory_clerks&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;If SQL Server itself is using majority of the memory in MemToLeave look at&amp;nbsp; MultiPage Allocator&amp;nbsp; values in DBCC MEMORYSTATUS output to determine which memory clerk is consuming the majority of the memory.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;sys.dm_os_memory_clerks output will also indicate which memory clerk is consuming majority of memory in MTL. Use the below query. You can further break down using sys.dm_os_memory_objects &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;select&amp;nbsp; *&amp;nbsp; from sys.dm_os_memory_clerks order by&amp;nbsp; multi_pages_kb&amp;nbsp; desc&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;select b.type,a.type,* from sys.dm_os_memory_objects a,sys.dm_os_memory_clerks b &lt;br /&gt;where a.page_allocator_address=b.page_allocator_address order by&amp;nbsp; b.multi_pages_kb,a.max_pages_allocated_count&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000; font-size: 10pt;"&gt;If SQL Server Owned memory is very less ,than determine if there are COM objects, SQL Mail, or 3rd party xprocs being used, and move them out of process if possible.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;COM Objects: &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;COM objects can be moved out of process by taking advantage of the optional third &lt;br /&gt;parameter ([context]) at each sp_OACreate call. If the int value 4 is passed as &lt;br /&gt;the third parameter to sp_OACreate, SQL will attempt to instantiate that object out &lt;br /&gt;of process in its own dllhost.exe process. More information on the [context] &lt;br /&gt;parameter can be found in the &amp;ldquo;sp_OACreate&amp;rdquo; topic in SQL Books Online. Warning: &lt;br /&gt;most COM objects will work fine when run out of process, but some will fail. We &lt;br /&gt;should run a few functional tests with context=4 to make sure that their objects &lt;br /&gt;can be successfully run out of process.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Linked Server OLEDB Providers:&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt; &lt;br /&gt;Linked server OLEDB providers can be moved out of process by setting the &lt;br /&gt;&amp;ldquo;AllowInProcess&amp;rdquo; OLEDB provider option for that provider to 0. Provider options &lt;br /&gt;are stored in the registry for each SQL instance at the location below:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Default Instance: HKLM\SOFTWARE\Microsoft\MSSQLServer\Providers &lt;br /&gt;Named Instance: HKLM \SOFTWARE\Microsoft\Microsoft SQL &lt;br /&gt;Server\&amp;lt;instance&amp;gt;\Providers&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;If the AllowInProcess reg value for the relevant 3rd party provider doesn&amp;rsquo;t exist, &lt;br /&gt;create it as a REG_DWORD value and set it to 0. Some OLEDB providers cannot be &lt;br /&gt;successfully run out of process, but most can.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Extended Stored Procedures: &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;span style="color: #000000;"&gt;Extended stored procedures always run in-process; there is no direct way to execute &lt;br /&gt;them out of process. However, in some cases it is possible to host the xp&amp;rsquo;s in a &lt;br /&gt;separate instance of SQL and execute them in the remote instance using &lt;br /&gt;server-to-server RPCs. This technique is detailed in KB 243428.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;sql server -g switch should be used as last option to resolve MTL errors.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Section 2 (BPOOL error):&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;If the Problem is with BPOOL &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Capture sum of singlePageAllocator for all nodes (Memory node Id = 0,1..n)from DBCC memorystatus output printed immediately after OOM errors in SQL Server errorlog.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;This will tell us how many KB each memory clerk is using in MTL.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;sys.dm_os_memory_clerks output will also indicate which memory clerk is consuming majority of memory in BPOOL (single_pages_kb). Use the below query. You can further break down using sys.dm_os_memory_objects &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;select&amp;nbsp; *&amp;nbsp; from sys.dm_os_memory_clerks order by&amp;nbsp; Single_pages_kb&amp;nbsp; desc&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;select b.type,a.type,* from sys.dm_os_memory_objects a,sys.dm_os_memory_clerks b &lt;br /&gt;where a.page_allocator_address=b.page_allocator_address order by&amp;nbsp; b.single_pages_kb&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;sys.dm_os_memory_clerks can provide a complete picture of SQL Server memory status and can be drilled down using sys.dm_os_memory_objects&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #ff0000;"&gt;&lt;span style="font-size: 10pt;"&gt;Note:&amp;nbsp; single_pages_kb is Bpool and&amp;nbsp; multi_pages_kb is MTL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;Other views which can help to troubleshoot SQL Server memory issues are&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 7.5pt 0in;"&gt;&lt;span style="mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: en;" lang="EN"&gt;&lt;span style="color: #000000; font-size: 10pt;"&gt;select * from sys.dm_os_memory_objects &lt;br /&gt;select * from sys.dm_os_memory_pools&amp;nbsp;&amp;nbsp; &lt;br /&gt;select * from sys.dm_os_memory_nodes &lt;br /&gt;select * from sys.dm_os_memory_cache_entries &lt;br /&gt;select * from sys.dm_os_memory_cache_hash_tables&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="list-style-type: disc; margin: 0in 0in 0pt;"&gt;&lt;strong&gt;&lt;span style="font-family: Verdana; font-size: x-small;"&gt;Few queries which we use to troubleshoot SQL Server memory issues.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div class="entrytext"&gt;
&lt;pre&gt;--Bpool stats&lt;/pre&gt;
&lt;pre&gt;select (bpool_committed * 8192)/ (1024*1024) as bpool_committed_mb&lt;/pre&gt;
&lt;pre&gt;, (cast(bpool_commit_target as bigint) * 8192) / (1024*1024) as bpool_target_mb,&lt;/pre&gt;
&lt;pre&gt;(bpool_visible * 8192) / (1024*1024) as bpool_visible_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_sys_info&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;-- Get me physical RAM installed&lt;/pre&gt;
&lt;pre&gt;-- and size of user VAS&lt;/pre&gt;
&lt;pre&gt;select physical_memory_in_bytes/(1024*1024) as phys_mem_mb, &lt;/pre&gt;
&lt;pre&gt;virtual_memory_in_bytes/(1024*1024) as user_virtual_address_space_size&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_sys_info&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;-- Get me other information about system memory&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select total_physical_memory_kb/(1024) as phys_mem_mb,&lt;/pre&gt;
&lt;pre&gt;available_physical_memory_kb/(1024) as avail_phys_mem_mb,&lt;/pre&gt;
&lt;pre&gt;system_cache_kb/(1024) as sys_cache_mb,&lt;/pre&gt;
&lt;pre&gt;(kernel_paged_pool_kb+kernel_nonpaged_pool_kb)/(1024) as kernel_pool_mb,&lt;/pre&gt;
&lt;pre&gt;total_page_file_kb/(1024) as total_virtual_memory_mb,&lt;/pre&gt;
&lt;pre&gt;available_page_file_kb/(1024) as available_virtual_memory_mb,&lt;/pre&gt;
&lt;pre&gt;system_memory_state_desc&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_sys_memory&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Get me memory information about SQLSERVR.EXE process&lt;/pre&gt;
&lt;pre&gt;-- GetMemoryProcessInfo() API used for this&lt;/pre&gt;
&lt;pre&gt;-- physical_memory_in_use_kb&lt;/pre&gt;
&lt;pre&gt;select physical_memory_in_use_kb/(1024) as sql_physmem_inuse_mb,&lt;/pre&gt;
&lt;pre&gt;locked_page_allocations_kb/(1024) as awe_memory_mb,&lt;/pre&gt;
&lt;pre&gt;total_virtual_address_space_kb/(1024) as max_vas_mb,&lt;/pre&gt;
&lt;pre&gt;virtual_address_space_committed_kb/(1024) as sql_committed_mb,&lt;/pre&gt;
&lt;pre&gt;memory_utilization_percentage as working_set_percentage,&lt;/pre&gt;
&lt;pre&gt;virtual_address_space_available_kb/(1024) as vas_available_mb,&lt;/pre&gt;
&lt;pre&gt;process_physical_memory_low as is_there_external_pressure,&lt;/pre&gt;
&lt;pre&gt;process_virtual_memory_low as is_there_vas_pressure&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_process_memory&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;select * from sys.dm_os_ring_buffers &lt;/pre&gt;
&lt;pre&gt;where ring_buffer_type like 'RING_BUFFER_RESOURCE%'&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;select memory_node_id as node, virtual_address_space_reserved_kb/(1024) as VAS_reserved_mb,&lt;/pre&gt;
&lt;pre&gt;virtual_address_space_committed_kb/(1024) as virtual_committed_mb,&lt;/pre&gt;
&lt;pre&gt;locked_page_allocations_kb/(1024) as locked_pages_mb,&lt;/pre&gt;
&lt;pre&gt;single_pages_kb/(1024) as single_pages_mb,&lt;/pre&gt;
&lt;pre&gt;multi_pages_kb/(1024) as multi_pages_mb,&lt;/pre&gt;
&lt;pre&gt;shared_memory_committed_kb/(1024) as shared_memory_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_nodes&lt;/pre&gt;
&lt;pre&gt;where memory_node_id != 64&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;with vasummary(Size,reserved,free) as ( select size = vadump.size,&lt;/p&gt;
&lt;pre&gt;reserved = SUM(case(convert(int, vadump.base) ^ 0)  when 0 then 0 else 1 end),&lt;/pre&gt;
&lt;pre&gt;free = SUM(case(convert(int, vadump.base) ^ 0x0) when 0 then 1 else 0 end)&lt;/pre&gt;
&lt;pre&gt;from&lt;/pre&gt;
&lt;pre&gt;(select CONVERT(varbinary, sum(region_size_in_bytes)) as size,&lt;/pre&gt;
&lt;pre&gt;region_allocation_base_address as base&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_virtual_address_dump&lt;/pre&gt;
&lt;pre&gt;where region_allocation_base_address &amp;lt;&amp;gt; 0x0&lt;/pre&gt;
&lt;pre&gt;group by region_allocation_base_address&lt;/pre&gt;
&lt;pre&gt;UNION(&lt;/pre&gt;
&lt;pre&gt;select CONVERT(varbinary, region_size_in_bytes),&lt;/pre&gt;
&lt;pre&gt;region_allocation_base_address&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_virtual_address_dump&lt;/pre&gt;
&lt;pre&gt;where region_allocation_base_address = 0x0)&lt;/pre&gt;
&lt;pre&gt;)&lt;/pre&gt;
&lt;pre&gt;as vadump&lt;/pre&gt;
&lt;p&gt;group by size)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;select * from vasummary&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;-- Get me all clerks that take some memory&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select * from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;where (single_pages_kb &amp;gt; 0) or (multi_pages_kb &amp;gt; 0)&lt;/pre&gt;
&lt;pre&gt;or (virtual_memory_committed_kb &amp;gt; 0)&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Get me stolen pages&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select (SUM(single_pages_kb)*1024)/8192 as total_stolen_pages&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Breakdown clerks with stolen pages&lt;/pre&gt;
&lt;pre&gt;select type, name, sum((single_pages_kb*1024)/8192) as stolen_pages&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;where single_pages_kb &amp;gt; 0&lt;/pre&gt;
&lt;pre&gt;group by type, name&lt;/pre&gt;
&lt;pre&gt;order by stolen_pages desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Get me the total amount of memory consumed by multi_page consumers&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select SUM(multi_pages_kb)/1024 as total_multi_pages_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- What about multi_page consumers&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select type, name, sum(multi_pages_kb)/1024 as multi_pages_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;where multi_pages_kb &amp;gt; 0&lt;/pre&gt;
&lt;pre&gt;group by type, name&lt;/pre&gt;
&lt;pre&gt;order by multi_pages_mb desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Let's now get the total consumption of virtual allocator&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select SUM(virtual_memory_committed_kb)/1024 as total_virtual_mem_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Breakdown the clerks who use virtual allocator&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select type, name, sum(virtual_memory_committed_kb)/1024 as virtual_mem_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;where virtual_memory_committed_kb &amp;gt; 0&lt;/pre&gt;
&lt;pre&gt;group by type, name&lt;/pre&gt;
&lt;pre&gt;order by virtual_mem_mb desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Is anyone using AWE allocator?&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select SUM(awe_allocated_kb)/1024 as total_awe_allocated_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- Who is the AWE user?&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select type, name, sum(awe_allocated_kb)/1024 as awe_allocated_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;where awe_allocated_kb &amp;gt; 0&lt;/pre&gt;
&lt;pre&gt;group by type, name&lt;/pre&gt;
&lt;pre&gt;order by awe_allocated_mb desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- What is the total memory used by the clerks?&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select (sum(multi_pages_kb)+&lt;/pre&gt;
&lt;pre&gt;SUM(virtual_memory_committed_kb)+&lt;/pre&gt;
&lt;pre&gt;SUM(awe_allocated_kb))/1024&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;-- Does this sync up with what the node thinks?&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;select SUM(virtual_address_space_committed_kb)/1024 as total_node_virtual_memory_mb,&lt;/pre&gt;
&lt;pre&gt;SUM(locked_page_allocations_kb)/1024 as total_awe_memory_mb,&lt;/pre&gt;
&lt;pre&gt;SUM(single_pages_kb)/1024 as total_single_pages_mb,&lt;/pre&gt;
&lt;pre&gt;SUM(multi_pages_kb)/1024 as total_multi_pages_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_nodes&lt;/pre&gt;
&lt;pre&gt;where memory_node_id != 64&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;-- Total memory used by SQL Server through SQLOS memory nodes&lt;/pre&gt;
&lt;pre&gt;-- including DAC node&lt;/pre&gt;
&lt;pre&gt;-- What takes up the rest of the space?&lt;/pre&gt;
&lt;pre&gt;select (SUM(virtual_address_space_committed_kb)+&lt;/pre&gt;
&lt;pre&gt;SUM(locked_page_allocations_kb)+&lt;/pre&gt;
&lt;pre&gt;SUM(multi_pages_kb))/1024 as total_sql_memusage_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_nodes&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;-- &lt;/pre&gt;
&lt;pre&gt;-- Who are the biggest cache stores?&lt;/pre&gt;
&lt;pre&gt;select name, type, (SUM(single_pages_kb)+SUM(multi_pages_kb))/1024 &lt;/pre&gt;
&lt;pre&gt;as cache_size_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_cache_counters&lt;/pre&gt;
&lt;pre&gt;where type like 'CACHESTORE%'&lt;/pre&gt;
&lt;pre&gt;group by name, type&lt;/pre&gt;
&lt;pre&gt;order by cache_size_mb desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;-- Who are the biggest user stores?&lt;/pre&gt;
&lt;pre&gt;select name, type, (SUM(single_pages_kb)+SUM(multi_pages_kb))/1024 &lt;/pre&gt;
&lt;pre&gt;as cache_size_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_cache_counters&lt;/pre&gt;
&lt;pre&gt;where type like 'USERSTORE%'&lt;/pre&gt;
&lt;pre&gt;group by name, type&lt;/pre&gt;
&lt;pre&gt;order by cache_size_mb desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;--&lt;/pre&gt;
&lt;pre&gt;-- Who are the biggest object stores?&lt;/pre&gt;
&lt;pre&gt;select name, type, (SUM(single_pages_kb)+SUM(multi_pages_kb))/1024 &lt;/pre&gt;
&lt;pre&gt;as cache_size_mb&lt;/pre&gt;
&lt;pre&gt;from sys.dm_os_memory_clerks&lt;/pre&gt;
&lt;pre&gt;where type like 'OBJECTSTORE%'&lt;/pre&gt;
&lt;pre&gt;group by name, type&lt;/pre&gt;
&lt;pre&gt;order by cache_size_mb desc&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;select mc.type, mo.type from sys.dm_os_memory_clerks mc&lt;/pre&gt;
&lt;pre&gt;join sys.dm_os_memory_objects mo&lt;/pre&gt;
&lt;pre&gt;on mc.page_allocator_address = mo.page_allocator_address&lt;/pre&gt;
&lt;pre&gt;group by mc.type, mo.type&lt;/pre&gt;
&lt;pre&gt;order by mc.type, mo.type&lt;/pre&gt;
&lt;pre&gt;go&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;div id="codeSnippetWrapper" style="line-height: 13.65pt; list-style-type: disc;"&gt;
&lt;div id="codeSnippet" style="line-height: 12pt; width: 100%; direction: ltr; overflow: visible;"&gt;
&lt;p style="margin-top: 1px; margin-bottom: 1px;"&gt;Other performance blogs:&lt;/p&gt;
&lt;/div&gt;
&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/" href="http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/basics-of-sql-server-memory-architecture/&lt;/a&gt;&lt;/div&gt;
&lt;div style="line-height: 13.65pt; list-style-type: disc;"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/" href="http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/io-bottlenecks/&lt;/a&gt;&lt;/div&gt;
&lt;div style="line-height: 13.65pt; list-style-type: disc;"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-server-agent/sql-agent-maxworkerthreads-and-agent-subsystem/" href="http://mssqlwiki.com/sqlwiki/sql-server-agent/sql-agent-maxworkerthreads-and-agent-subsystem/"&gt;http://mssqlwiki.com/sqlwiki/sql-server-agent/sql-agent-maxworkerthreads-and-agent-subsystem/&lt;/a&gt;&lt;/div&gt;
&lt;div style="line-height: 13.65pt; list-style-type: disc;"&gt;&lt;a title="http://mssqlwiki.com/sqlwiki/sql-performance/async_network_io-or-network_io/" href="http://mssqlwiki.com/sqlwiki/sql-performance/async_network_io-or-network_io/"&gt;http://mssqlwiki.com/sqlwiki/sql-performance/async_network_io-or-network_io/&lt;/a&gt;&lt;/div&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;Thanks&lt;/pre&gt;
&lt;pre&gt;Karthick &lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10320565" width="1" height="1"&gt;</content><author><name>Karthick P.K - karthick krishnamurthy</name><uri>http://blogs.msdn.com/Karthick-PK/ProfileUrlRedirect.ashx</uri></author><category term="Severity: 17" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Severity_3A00_+17/" /><category term="WARNING: Clearing procedure cache to free contiguous memory" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/WARNING_3A00_+Clearing+procedure+cache+to+free+contiguous+memory/" /><category term="State: 123.There is insufficient system memory to run this query." scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/State_3A00_+123-There+is+insufficient+system+memory+to+run+this+query_2E00_/" /><category term="Could not create server event thread.BPool::Map: no remappable address found." scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Could+not+create+server+event+thread-BPool_3A003A00_Map_3A00_+no+remappable+address+found_2E00_/" /><category term="Failed Virtual Allocate Bytes: FAIL_VIRTUAL_RESERVE" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Failed+Virtual+Allocate+Bytes_3A00_+FAIL_5F00_VIRTUAL_5F00_RESERVE/" /><category term="Error: 701" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Error_3A00_+701/" /><category term="BPool::Map: no remappable address found." scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/BPool_3A003A00_Map_3A00_+no+remappable+address+found_2E00_/" /><category term="State: 123." scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/State_3A00_+123_2E00_/" /><category term="FAIL_VIRTUAL_RESERVE" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/FAIL_5F00_VIRTUAL_5F00_RESERVE/" /><category term="Could not create server event thread" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Could+not+create+server+event+thread/" /><category term="Failed Virtual Allocate Bytes" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Failed+Virtual+Allocate+Bytes/" /><category term="State: 123.There is insufficient system memory to run this query" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/State_3A00_+123-There+is+insufficient+system+memory+to+run+this+query/" /><category term="Error: Error: 701" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/Error_3A00_+Error_3A00_+701/" /><category term="BufferPool out of memory condition" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/BufferPool+out+of+memory+condition/" /><category term="sql server -g" scheme="http://blogs.msdn.com/b/karthick_pk/archive/tags/sql+server+_2D00_g/" /></entry></feed>