<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'denali' and 'MPA'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=denali,MPA&amp;orTags=0</link><description>Search results matching tags 'denali' and 'MPA'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>What causes Multi-Page allocations?</title><link>http://sqlblog.com/blogs/sqlos_team/archive/2011/01/27/what-causes-multi-page-allocations.aspx</link><pubDate>Thu, 27 Jan 2011 05:40:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:32948</guid><dc:creator>SQLOS Team</dc:creator><description>&lt;p&gt;Writing about changes in the Denali Memory Manager In his &lt;a href="http://blogs.msdn.com/b/sqlosteam/archive/2011/01/04/sql-server-memory-manager-changes-in-denali.aspx"&gt;last post&lt;/a&gt; Rusi mentioned: "&lt;em&gt; In previous SQL versions only the 8k allocations were limited by&amp;nbsp;the ‘max server memory’ configuration option.&amp;nbsp; Allocations larger than 8k weren’t constrained&lt;/em&gt;."&lt;/p&gt;
&lt;p&gt;In SQL Server versions before Denali single page allocations and multi-Page allocations are handled by different components, the Single Page Allocator (which is responsible for Buffer Pool allocations and governed by 'max server memory') and the Multi-Page allocator (MPA) which handles allocations of greater than an 8K page. If there are many multi-page allocations this can affect how much memory needs to be&amp;nbsp;reserved outside 'max server memory' which may in turn involve setting the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/ms190737.aspx"&gt;-g memory_to_reserve&lt;/a&gt;&amp;nbsp;startup parameter. We'll follow up with more generic articles on the new Memory Manager structure, but in this post I want to clarify what might cause these larger allocations. &lt;/p&gt;
&lt;p&gt;So what kinds of query result in MPA activity? I was asked this question the other day after delivering an MCM webcast on Memory Manager changes in Denali.&amp;nbsp;After asking around our Dev team&amp;nbsp;I was connected to one of our test leads Sangeetha who had&amp;nbsp;tested the plan cache, and kindly provided this example of an MPA intensive query:&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;A workload that has stored procedures with a large # of parameters (say &amp;gt; 100, &amp;gt; 500), and then invoked via large ad hoc batches, where each SP has different parameters will result in a plan being cached for this “exec proc” batch. This plan will result in MPA. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Exec proc_name @p1, ….@p500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Exec proc_name @p1, ….@p500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Exec proc_name @p1, ….@p500&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Go&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Another workload would be large adhoc batches of the form:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Select * from t where col1 in (1, 2, 3, ….500)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Select * from t where col1 in (1, 2, 3, ….500)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Select * from t where col1 in (1, 2, 3, ….500)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;…&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Go&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;o:p&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In Denali all page allocations are handled by an "Any size page allocator" and&amp;nbsp;included in&amp;nbsp;'max server memory'. The buffer pool effectively becomes a client of the any size page allocator, which in turn relies on the memory manager.&lt;/p&gt;
&lt;p&gt;- Guy&lt;/p&gt;
Originally posted at http://blogs.msdn.com/b/sqlosteam/</description></item></channel></rss>