{"id":838,"date":"2011-10-11T19:44:15","date_gmt":"2011-10-12T00:44:15","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=838"},"modified":"2011-10-11T19:44:15","modified_gmt":"2011-10-12T00:44:15","slug":"sql-server-memory-configuration","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=838","title":{"rendered":"SQL Server memory configuration"},"content":{"rendered":"<h1><a href=\"http:\/\/www.eraofdata.com\/blog\/sql-server-memory-configuration\/\" target=\"_blank\">SQL Server memory configuration<\/a><\/h1>\n<div>\n<p>One of the things that I frequently come across when reviewing SQL Server installations is just how many of them have not been set up with appropriate memory configuration settings, or, as in many cases, not set up in the way the administrators of the system had assumed they were; usually the dbas thought the system was set up to use all e.g. 8GB of RAM, but no changes had been made to the OS or SQL Server configuration, so their (32-bit) SQL Server would only be accessing 2 GB, and reporting that it was using 1.6 GB.<\/p>\n<p><!--more--><\/p>\n<p>The problem is due in part to the fact that on 32-bit systems configuration changes usually have to be made both in SQL Server and at the OS level, and in part to the sprawl of documentation available on configuring SQL Server\u2019s memory settings, as opposed to a single jumping off point which runs through all the settings and considerations that need to be made.<br \/>\nAdd to that the black art of establishing exactly how much memory SQL Server\u00a0<em>is<\/em>\u00a0using (most of the obvious options will only show how much memory the buffer pool is using) and it\u2019s easy to see why it\u2019s such a problem area.<\/p>\n<p>In this post I\u2019ll attempt to clear some of the smog and provide what I hope will be one document which answers most of the questions that arise about configuring SQL Server\u2019s memory usage.<br \/>\nThis discussion will cover configuring memory for SQL Server 2000, SQL Server 2005 and SQL Server 2008 (with the exception of the Resource Governor). This blog assumes an\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms143685.aspx\" target=\"_blank\">edition of SQL Server<\/a>\u00a0that is not internally limited in its memory usage.<\/p>\n<h2>32-bit or 64-bit?<\/h2>\n<p>There\u2019s a big difference between the memory configuration settings between 64-bit SQL Server and 32-bit SQL Server, so it\u2019s not possible to start a discussion about SQL Server\u2019s memory management without clarifying whether we are dealing with 32-bit versions or 64-bit versions of the product, as this is key to how much memory SQL Server can address, and (almost as importantly) how it addresses that memory.<\/p>\n<h2>Configuring 32-bit SQL Server<\/h2>\n<p>Until fairly recently 32-bit software was ubiquitous. The server Windows operating systems were 32-bit, your desktop, usually Windows XP was 32-bit. Therefore, I\u2019ll be focusing a fair bit on 32-bit SQL Server as this is what requires the most configuration, and also where most of the confusion lies.<\/p>\n<p>So, here goes.<\/p>\n<p>The amount of memory a 32-bit process can access is 2^32 or 4294967296 bytes, or 4 GB.<br \/>\nOn a 32-bit Windows OS this 4 GB of memory is not all addressable by a single process. Instead, it\u2019s partitioned by the OS into two address spaces. 2 GB is kept by the OS (commonly referred to as the kernel) and the remaining 2 GB is the user mode address space, or the area each application (process) will have access to. Whilst each user mode process gets 2 GB as its addressable memory range, the kernel mode area is shared between all processes. SQL Server runs in the user mode address space and is bound by default to the 2 GB of memory limit on a 32-bit OS.<br \/>\nThis directly addressable memory will hereon be referred to by what it is more commonly known as, the virtual address space or\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa366912.aspx\" target=\"_blank\">VAS<\/a>.<\/p>\n<p>SQL Server\u2019s default out-of-the-box memory limit is deliberately set to a very high value of 2147483647 , which basically means all available memory, but as you should now know, there\u2019s no way it can actually use anywhere near that much memory, particularly on a 32-bit platform.<\/p>\n<p>64-bit operating systems have a far far bigger address space open to them; 8 TB to be exact. Before you run off to your calculator to evaluate 2^64, the answer won\u2019t be 8TB, but 8TB is what each user mode application gets due to current hardware and OS limitations. The kernel also gets 8TB and this kernel address space is shared by all processes, just as in 32-bit Windows.<\/p>\n<p>Having said all that, I should point out that no current MS Windows OS can address more than 2 TB.<\/p>\n<p>What this means for 64-bit SQL Server is that out of the box, it can address all the memory on a server without any special configuration changes either within SQL Server or at the OS level. The only thing you need to look at is a cap on its memory usage; capping memory usage is covered in the\u00a0<a href=\"http:\/\/www.eraofdata.com\/blog\/sql-server-memory-configuration\/#maxservermemory\">\u2018max server memory\u2019 and \u2018min server memory\u2019<\/a>\u00a0section which is further down.<\/p>\n<h2>To \/3GB or not to \/3GB<\/h2>\n<p>So, as 32-bit applications are natively restricted to a 2 GB VAS, OS configuration tweaks are required to allow access to more than 2 GB, and these are covered next.<\/p>\n<p>The first modification is one that, rather ironically, should be used as a last resort. Ideally, it should be used on the advice of Microsoft Support (PSS).<br \/>\nI\u2019m choosing to get it out of the way now because the \/3GB setting is probably the most well known and most misused.<br \/>\n\/3GB allows a 32-bit process to increase its VAS to 3 GB by taking away 1 GB of address space from the kernel, and this is why it\u2019s a last resort; there\u2019s no such thing as a free lunch as the removal of 1 GB of addressable memory from the OS can introduce instability. More on that shortly.<\/p>\n<p>To allow a 32-bit process to gain a 3 GB VAS you have to add the\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms791558.aspx\" target=\"_blank\">\/3GB<\/a>\u00a0switch to the Windows boot.ini file.<\/p>\n<p>As I stated, this can introduce system instability by starving the OS of System Page Table Entries (PTEs). A discussion about PTEs is out of the scope of this blog, but its effects can be dramatic and cause blue-screens. The good news is that this mainly affected Windows 2000 so you should be fine if you\u2019re on a later Windows version.<\/p>\n<p>If you\u2019re still looking after a legacy system, there is some scope for manoeuvre here, by adding the<a href=\"http:\/\/support.microsoft.com\/kb\/316739\" target=\"_blank\">\/USERVA<\/a>\u00a0switch to the boot.ini it is possible to reduce the VAS increase from a straight 3 GB to a lower user-defined amount which will give the OS room to breathe, and thus resolve any instability issues.<\/p>\n<p>The main reason you will be advised by PSS to use \/3GB is if you are suffering VAS starvation issues, such as a bloated procedure cache as it can only reside in VAS memory (also see the next section on\u00a0<strong>MemToLeave<\/strong>) because 32-bit version of SQL Server only allow database pages to reside in the part of the SQL Server memory cache (called the buffer pool) that is utilising awe enabled memory.<\/p>\n<h2>MemToLeave<\/h2>\n<p>(EDIT:[20110630] The correct terminology for this is\u00a0<a href=\"http:\/\/sqlblog.com\/blogs\/jonathan_kehayias\/archive\/2009\/07\/07\/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx\">Virtual Address Space Reservation<\/a>.)<br \/>\nBecause of the inherent address space limitations of a 32-bit process, a certain amount of memory has to be set aside by SQL Server on startup that SQL Server uses for overheads. This memory is set aside in case it all gets used by the buffer pool.<\/p>\n<p>COM objects, extended stored procs, memory allocations exceeding 8K and the memory allocated to the threads SQL Server creates to service e.g. user connections come from a section of memory within the VAS but outside the buffer pool which is typically referred to as the MemToLeave area. This is 384 MB by default on an e.g. 2-proc 32-bit SQL. If you want to know more about how it is calculated, check\u00a0<a href=\"http:\/\/sqlblog.com\/blogs\/jonathan_kehayias\/archive\/2009\/07\/07\/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx\" target=\"_blank\">Jonathan Kehayias\u2019s post<\/a>\u00a0covering this.<\/p>\n<p>0.5 MB is the default thread stack size for a thread on 32-bit Windows. 64-bit Windows has a default stack size of 2 MB or 4 MB depending on which 64-bit flavour of Windows you are running (AMD x64 or IA64).<br \/>\nSQL Server 2005 and beyond uses a\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms187024.aspx\" target=\"_blank\">formula<\/a>\u00a0to calculate the max worker threads setting which affects the size of the MemToLeave area.<br \/>\nThere is a SQL Server startup parameter (<strong>-g<\/strong>) which can be used to increase the MemToLeave area, but again, only do this if advised by PSS (it\u2019s ignored on 64-bit as MemToLeave or VAS reservation won\u2019t be an issue on that architecture) as this will reduce the maximum amount of memory the buffer pool can therefore use.<\/p>\n<h4>4 GB of RAM and beyond<\/h4>\n<p>So, we know 32-bit SQL Server can use 2 GB out of the box, and up to 3 GB (with an OS tweak that is best avoided, if at all possible).<br \/>\nHowever, 32-bit SQL Server can benefit from much more memory than 3 GB with the help of OS and SQL Server configuration modifications which will be covered next.<\/p>\n<h2>\/PAE<\/h2>\n<p>To address more than 4 GB of RAM on 32-bit Windows, the OS needs to have the\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms791485.aspx\" target=\"_blank\">\/PAE<\/a>\u00a0switch added to the boot.ini file, although if your system supports hot-swappable memory you won\u2019t need to add this as Windows should automatically be able to see the additional memory. If you\u2019re not sure, take a look at how much memory the OS can see via System properties; if you have more than 4 GB installed and the OS is only showing 4 GB, review your boot.ini settings. I\u2019m not mentioning specific Windows versions because the \/PAE switch applies to all current 32-bit versions of Windows.<br \/>\n(EDIT:[20110630] For Windows Server 2008 you have to run \u2018BCDEDIT \/SET PAE FORCEENABLE\u2019 from a CMD prompt running under administrator privileges).<\/p>\n<h2><em>Both<\/em>\u00a0\/PAE and \/3GB<\/h2>\n<p>Some systems have both \/3GB and \/PAE enabled.<br \/>\nThis is fine as long as the system does not have more than 16 GB of RAM. Add any more memory and\u00a0<a href=\"http:\/\/support.microsoft.com\/kb\/283037\" target=\"_blank\">Windows will not recognise it<\/a>\u00a0because of the overhead required to manage the additional memory.<\/p>\n<h2>Clusters<\/h2>\n<p>No special configuration settings regarding memory settings are required for a cluster, but I thought I better\u00a0mention clusters specifically because you won\u2019t believe how many installations there are out there where there are different settings on different nodes within the same cluster.<br \/>\nSo, make sure any OS setting changes like \/3GB or \/PAE are consistently applied across\u00a0<em>all<\/em>\u00a0nodes.<\/p>\n<h2>Enable AWE<\/h2>\n<p>After configuring the OS, you\u2019ll need to configure SQL Server by enabling AWE (Address Windowing Extensions). AWE is in essence a technique for \u2018paging\u2019 in sections of memory beyond the default addressable range.<br \/>\nAWE can be enabled in SQL Server using Query Analyzer\/SQL Server Management Studio (SSMS) via the following statements:<br \/>\n<code><br \/>\nsp_configure 'show advanced options', 1<br \/>\nRECONFIGURE<br \/>\nGO<br \/>\nsp_configure 'awe enabled', 1<br \/>\nRECONFIGURE<br \/>\nGO<br \/>\n<\/code><br \/>\nAWE enablement is not a dynamic option and will require a SQL Server restart, so before you do that make sure the SQL Server service account has the \u2018Lock Pages in Memory\u2019 privilege assigned to it.<br \/>\nOnce AWE has been enabled within SQL Server and the \u2018Lock Pages in Memory\u2019 privilege has been assigned you should be good to go after a restart.<\/p>\n<h2>\u2018max server memory\u2019 and \u2018min server memory\u2019<\/h2>\n<p>The more memory you give SQL Server, the greater the need to set an upper limit on how much it uses. When you start SQL Server it\u2019ll ramp up its memory usage until it has used up all the memory it can access, which will either be an internal OS limit or a SQL Server configured limit.<br \/>\nA 32-bit SQL Server instance will therefore grab up to 2 GB if the workload demands it and it is on default settings.<br \/>\nAn awe enabled SQL Server instance will go on using up all the memory on the system if the workload is there and an upper limit on its memory usage is not set.<\/p>\n<p>Setting a limit has the double-benefit of not starving the OS of resources and avoiding \u2018Out of memory\u2019 errors which can occur on SQL Server systems that may have a lot of memory. The latter (rather contradictory) situation can arise because SQL Server will try and allocate more memory when it is already at the system limit (if no upper limit has been set via the \u2018max server memory\u2019 setting) instead of freeing up memory it is already using.<\/p>\n<h2>Configuring memory for multiple instances<\/h2>\n<p>A third reason to set an upper limit is if you have more than one SQL Server instance installed on a single host, as this will stop the instances competing for memory.<br \/>\nAllocate a high enough \u2018max server memory\u2019 limit to each instance to allow it to do its job without running into memory starvation issues, whilst reserving the bulk of the memory for higher priority instances (if any)\u00a0<em>and<\/em>\u00a0the OS.<br \/>\nThis is where benchmarking comes in handy.<\/p>\n<p>To set a max server memory limit of 12 GB via Query Analyzer\/SSMS:<br \/>\n<code><br \/>\nsp_configure 'max server memory', 12288<br \/>\nRECONFIGURE<br \/>\nGO<br \/>\n<\/code><\/p>\n<p>SQL Server ramps up its memory usage because by default it is set to use no memory on startup. This is controlled by the \u2018min server memory\u2019 setting. Specifying this to a higher value has the benefit of reserving a set amount of memory for SQL Server from the off which can provide a slight performance benefit, especially on busy systems. It\u2019s actually not uncommon to see \u2018min server memory\u2019 and \u2018max server memory\u2019 set to the same value, to reserve all of SQL Server\u2019s memory straight away. The downside is SQL Server will take slightly longer to start up than if \u2018min server memory\u2019 was set to a low value.<\/p>\n<h2>SQL does not\u00a0<em>really<\/em>\u00a0release memory<\/h2>\n<p>This will probably get me into a bit of trouble, as there are KBs that clearly state that SQL Server releases memory when the OS is under pressure.<br \/>\nTrue, but only when it\u2019s under a\u00a0<strong>lot<\/strong>\u00a0of pressure (although this is getting better with each version of SQL Server), and by then it\u2019s often too late as the system is usually in such a degraded state by that stage that a restart is necessary.<br \/>\nThat\u2019s why it\u2019s vital to set an upper limit on its memory usage via the \u2018max server memory\u2019 setting.<br \/>\n(Edit [20110627): Speaking from experience, this problem manifested itself most noticeably on SQL Server 2000 and earlier but the problem seems to have disappeared from SQL 2005 onwards. Let me know if you disagree (and send me the evidence!)).<\/p>\n<h2>Memory corruption<\/h2>\n<p>Slightly off-topic, but this is an appropriate place to bring this up.<br \/>\nCertain builds of\u00a0<a href=\"http:\/\/support.microsoft.com\/?kbid=838647\" target=\"_blank\">Windows 2000<\/a>\u00a0and\u00a0<a href=\"http:\/\/support.microsoft.com\/Default.aspx?kbid=834628\" target=\"_blank\">Windows Server 2003<\/a>\u00a0contained a potentially serious memory corruption problem which affected SQL Server more than other applications, mainly because there are few applications that run on Windows that can utilise the amount of memory SQL Server does.<br \/>\nIt&#8217;s difficult to overstate the problems this can cause, so make sure you&#8217;re on the appropriate Windows Service Packs if you&#8217;re running SQL Server on a PAE enabled system.<br \/>\nAnother issue that arose in\u00a0<a href=\"http:\/\/support.microsoft.com\/default.aspx?scid=kb;en-us;899761\" target=\"_blank\">SQL Server 2000 SP4<\/a>\u00a0was a bug that meant SQL Server only saw half the memory on awe enabled systems, although it was identified quickly and the hotfix for this was placed alongside the SP4 download.<\/p>\n<h2>32-bit SQL Server on 64-bit Windows<\/h2>\n<p>If you 32-bit SQL Server on 64-bit Windows the SQL Server process can access the entire 4 GB VAS.<\/p>\n<h2>Checking SQL Server&#8217;s memory usage<\/h2>\n<p>This is another area where there is lot of confusion, so below is a run-through of the most common methods for confirming SQL Server&#8217;s memory usage.<\/p>\n<h2>Ignore Task Manager<\/h2>\n<p>If you have an awe enabled SQL Server instance, do not rely on Task Manager to display memory usage as it does not show the AWE memory a process is using, so the memory usage figure it presents for the SQL Server process (sqlservr.exe) will be incorrect.<\/p>\n<h2>DBCC MEMORYSTATUS<\/h2>\n<p>Running the above command outputs the memory usage of SQL Server including how that memory is allocated, so unless you need to know how and where that memory is being used, the output it generates can be a bit bewildering. The important bits of this output pertaining to SQL Server&#8217;s total memory usage are as follows:<br \/>\n<code><br \/>\nBuffer Counts\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Buffers<br \/>\n------------------------------ --------------------<br \/>\nCommitted\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a03872<br \/>\nTarget\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a065536<br \/>\nHashed\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02485<br \/>\nStolen Potential\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a060972<br \/>\nExternal Reservation\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00<br \/>\nMin Free\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a064<br \/>\nVisible\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a065536<br \/>\nAvailable Paging File\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0702099<br \/>\n<\/code><br \/>\nThe key figures in the above output are committed, target and hashed.<br \/>\nCommitted is the amount of memory in use by the buffer pool and includes AWE pages.<br \/>\nTarget is how big SQL Server wants the buffer to grow, so you can infer from this whether SQL Server wants more memory or is releasing memory.<br \/>\nThere&#8217;s an excellent KB on interpreting all the output\u00a0<a href=\"http:\/\/support.microsoft.com\/?id=271624\" target=\"_blank\">INF: Using DBCC MEMORYSTATUS to Monitor SQL Server Memory Usage<\/a>\u00a0for SQL Server 2000 and\u00a0<a href=\"http:\/\/support.microsoft.com\/kb\/907877\/en-us\" target=\"_blank\">How to use the DBCC MEMORYSTATUS command to monitor memory usage on SQL Server 2005<\/a>.<br \/>\nEdit (05\/02\/09): Remember the buffer count numbers refer to pages of memory which are 8K in SQL Server<\/p>\n<h4>System Monitor (perfmon)<\/h4>\n<p>Perfect way to get a quick reference on exactly how much memory SQL Server is using at that moment. Start System Monitor and add the SQL Server: Memory Manager: Total Server Memory (KB) counter.<\/p>\n<p>Replace &#8220;SQL Server&#8221; with MSSQL$ and the name of the named instance if it&#8217;s not a default instance, e.g. MSSQL$INSTANCE1.<\/p>\n<h2>&#8216;Total&#8217; memory usage<\/h2>\n<p>When trying to establish exactly how much memory SQL Server is using it&#8217;s not just the buffer pool memory you have look at, but the MemToLeave area as well. The key point to bear in mind here is that it&#8217;s not only SQL Server that can make allocations from this latter area of memory but third party processes as well, which can make it impossible to precisely account for SQL Server&#8217;s absolute memory usage, contrary to some myths out there about calculating SQL Server&#8217;s memory usage via e.g. DBCC MEMORYSTATUS, as such methods can only account for SQL Server&#8217;s\u00a0<em>own<\/em>\u00a0memory allocations and\u00a0<em>not<\/em>\u00a0allocations by foreign processes.<\/p>\n<p>Edit [20110627]: Soft NUMA section removed.<\/p>\n<h2>64-bit<\/h2>\n<p>I mentioned at the start of this post that all you have to worry about for 64-bit SQL Server is setting a max memory limit as SQL Server can access all the memory current Windows operating systems can support, and 8 TB in total. That\u2019s mostly true, with the exception of a certain privilege that the SQL Server service account needs, and that\u2019s the \u2018Lock Pages in Memory\u2019 privilege.<br \/>\nThis privilege is vital as it prevents the OS from paging out SQL Server memory to the swap file.<br \/>\nWith the introduction of SQL Server 2005, this right was restricted on 64-bit Windows to\u00a0<a href=\"http:\/\/support.microsoft.com\/kb\/918483\/en-us\" target=\"_blank\">only take effect on Enterprise Editions of SQL Server<\/a>, so if you\u2019re wondering why your huge new multi-gigabyte multi-core 64-bit system is paging like crazy, this might be why. [Edit: This has finally been reversed for both SQL Server 2005 and SQL Server 2008 Standard Editions:<a href=\"http:\/\/blogs.msdn.com\/psssql\/archive\/2009\/04\/24\/sql-server-locked-pages-and-standard-sku.aspx\" target=\"_blank\">http:\/\/blogs.msdn.com\/psssql\/archive\/2009\/04\/24\/sql-server-locked-pages-and-standard-sku.aspx<\/a><br \/>\nWhilst we\u2019re on the subject of paging on 64-bit SQL Server systems, take a look at the following KB:<br \/>\n<a href=\"http:\/\/support.microsoft.com\/default.aspx\/kb\/918483\" target=\"_blank\">How to reduce paging of buffer pool memory in the 64-bit version of SQL Server 2005<\/a>\u00a0which covers issues a number of issues that cause SQL Server\u2019s (Standard or Enterprise editions) memory to be paged out.<\/p>\n<h2>In summary\u2026<\/h2>\n<p>The table below describes how much memory SQL Server can use, and assumes an edition of SQL Server that has no internal limitations as to how much memory it can use, e.g. Express and Workgroup editions are limited to 1 GB and 3GB respectively.<\/p>\n<table width=\"446\" border=\"1\">\n<tbody>\n<tr>\n<td rowspan=\"2\" align=\"left\">SQL Server type<\/td>\n<td colspan=\"3\">Installed physical memory<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">Up to 4GB<\/td>\n<td>More than 4GB (\/PAE enabled\u00a0<sup>1<\/sup>)<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\" align=\"left\">32-bit SQL Server<\/td>\n<td align=\"left\">Default memory usage<\/td>\n<td>With \/3GB\u00a0<sup>2<\/sup><\/td>\n<td rowspan=\"2\" align=\"center\">All available RAM<sup>3<\/sup><\/td>\n<\/tr>\n<tr>\n<td>2 GB<\/td>\n<td>3 GB<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">64-bit SQL Server<\/td>\n<td colspan=\"3\" align=\"center\">All available RAM\u00a0<sup>3<\/sup><\/td>\n<\/tr>\n<tr>\n<td colspan=\"4\">\n<sup>1<\/sup>\u00a0Not all 32-bit systems now need to have \/PAE explicitly set in boot.ini for the OS to see more than 4 GB of RAM\u00a0<sup>2<\/sup>. Assuming \/USERVA switch has not been used to tune memory usage to between 2 GB and 3 GB\u00a0<sup>3<\/sup>. Assuming\u00a0<code>'max server memory'<\/code>\u00a0is left on defaults, otherwise SQL Server will use no more memory than that stipulated by the\u00a0<code>'max server memory'<\/code>setting.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>When I started this post I wanted to keep it as short and succinct as possible, but there\u2019s a lot more to configuring SQL Server\u2019s memory usage than simply setting a \u2018max server memory\u2019 limit. Configuring SQL Server\u2019s memory settings can be quite a complex undertaking, especially in a 32-bit environment. It\u2019s not easy to cover all the pertinent points without branching off and describing the different areas of its memory architecture, although I\u2019ve tried to provide the relevant information without going into too much detail.<br \/>\nHopefully, this blog has clarified how to configure SQL Server\u2019s memory usage and provided enough information to answer most memory configuration related questions, although, as you might have guessed, there\u2019s no black-and-white way of precisely determining SQL Server\u2019s memory usage as there are so many external processes that can make allocations from within SQL Server\u2019s address space\u2026<\/p>\n<p>Thanks also to Jonathan Keheyias for additional information and comments on this post. Please read<a href=\"http:\/\/sqlblog.com\/blogs\/jonathan_kehayias\/archive\/2009\/07\/07\/understanding-the-vas-reservation-aka-memtoleave-in-sql-server.aspx\">his post<\/a>\u00a0on this topic if you want to delve a bit deeper.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server memory configuration One of the things that I frequently come across when reviewing SQL Server installations is just how many of them have not been set up with appropriate memory configuration settings, or, as in many cases, not &#8230; <a class=\"more-link\" href=\"http:\/\/www.wildow.com\/blog\/?p=838\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-838","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=838"}],"version-history":[{"count":1,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/838\/revisions"}],"predecessor-version":[{"id":839,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/838\/revisions\/839"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=838"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}