<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.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>Rob's SQL Server Blog : Memory</title><link>http://blogs.technet.com/rob/archive/tags/Memory/default.aspx</link><description>Tags: Memory</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SQL Server and Windows Memory</title><link>http://blogs.technet.com/rob/archive/2008/05/15/sql-server-and-windows-memory.aspx</link><pubDate>Thu, 15 May 2008 17:02:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3055690</guid><dc:creator>robcarrol</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/rob/comments/3055690.aspx</comments><wfw:commentRss>http://blogs.technet.com/rob/commentrss.aspx?PostID=3055690</wfw:commentRss><description>&lt;P&gt;SQL Server 2000 Enterprise Edition introduced support for the&amp;nbsp;use of Windows 2000 Address Windowing Extensions (AWE) to address 8GB of memory on Windows 2000 Advanced Server and 32GB of memory on Windows 2000 Datacentre. With AWE, SQL Server can reserve memory not in use by other applications and the OS. Each instance must statically allocate the memory it needs. AWE memory can only be used for the data cache and not for executables, drivers, DLL's, etc.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SQL Server 2000 on Windows 2003/Windows 2000 Advanced Server/Windows 2000 Datacentre:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The use of /PAE and AWE allows SQL Server 2000 to use more than 4GB of RAM. Without /PAE, SQL can only use up to 3GB (with /3GB switch enabled in boot.ini). To allow AWE to use the the memory range above 16GB on Windows 2000 Datacentre, the /3GB switch &lt;STRONG&gt;must not&lt;/STRONG&gt; be enabled in the server's boot.ini file. When you allocate SQL Server AWE memory on a 32GB system, Windows 2000 may require at least 1GB memory to manage AWE.&lt;/P&gt;
&lt;P&gt;SQL Server 2000 Enterprise and Developer Editions are the only editions that can use AWE.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;BR&gt;USING AWE MEMORY (SQL Server 2000)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Run the database engine under a Windows account with the "lock data pages in memory" option enabled. SQL Server setup will automatically grant this permission. If you start an instance from the command prompt (sqlservr.exe), you must manually assign this permission using gpedit.msc. Set the sp_configure option AWE ENABLED and restart SQL Server.&lt;/P&gt;
&lt;P&gt;Instances of SQL Server 2000 do not dynamically manage the size of the address space when you enable AWE memory. When you enable AWE and start an instance of SQL 2000, one of the following occurs:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If sp_configure max server memory has been set and there are at least 3GB RAM free on the computer, the instance acquires the amount of memory specified in max server memory&lt;/LI&gt;
&lt;LI&gt;If the amount of memory available is less than max server memory (but more than 3GB), then the instance acquires almost all of the available memory and may leave only up to 128MB of memory free&lt;/LI&gt;
&lt;LI&gt;If max server memory has not been set and there is at least 3GB of free memory available, then the instance acquires almost all of the available memory and may leave only up to 128MB of memory free&lt;/LI&gt;
&lt;LI&gt;If there is less than 3GB of free memory available, memory is dynamically allocated and, regardless of the parameter setting for AWE ENABLED, SQL Server will run in non-AWE mode&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Evaluating Memory Usage&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Use System Monitor to obtain the correct amount of SQL Server memory usage:&lt;/P&gt;
&lt;UL&gt;
&lt;UL&gt;
&lt;LI&gt;Total Server Memory (KB)&lt;/LI&gt;
&lt;LI&gt;Select memory usage from sysperfinfo&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Running Multiple instances with AWE on SQL Server 2000&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Each instance must have a max server memory setting.&lt;/P&gt;
&lt;P&gt;Sum of max server memory values for all instances should be less than the amount of physical memory on the server. If the sum greater, some of the instances will either not start or will have less memory than is specified in max server memory.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;STRONG&gt;Windows 2000 Usage Considerations:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Before configuring Windows 2000 for AWE memory:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add the /PAE switch to boot.ini&lt;/LI&gt;
&lt;LI&gt;Add the /3GB switch to enable Windows 2000 Advanced Server and Windows 2000 Datacentre to support a 3GB virtual address space. This allows user applications to address 3 GB of virtual memory and reserves 1 GB of virtual memory for the operating system. However, if there is more than 16 GB of physical memory available on a computer, Windows 2000 needs 2 GB of virtual memory address space for system purposes and therefore can support only a 2-GB virtual address space.&lt;/LI&gt;
&lt;LI&gt;
&lt;P class=tl&gt;In order to allow AWE to use the memory range above 16 GB, be sure the /&lt;I&gt;3gb&lt;/I&gt; parameter is not in the boot.ini file. If it is, Windows 2000 will be unable to address any memory above 16 GB. When allocating SQL Server AWE memory on a 32-GB system, Windows 2000 may require at least 1 GB of available memory to manage AWE. Therefore, when starting an instance of SQL Server with AWE enabled, it is recommend you do not use the default &lt;B&gt;max server memory &lt;/B&gt;setting, but instead limit it to 31 GB or less&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=tl&gt;Using Failover Clustering:&lt;/P&gt;
&lt;P&gt;If you are using SQL Server 2000 failover clustering and AWE memory, you must ensure that the summed value of the &lt;B&gt;max server memory&lt;/B&gt; settings for all the instances is less than the lowest amount of physical RAM available on any of the servers in the failover cluster. If the failover node has less physical memory than the original node, the instances of SQL Server 2000 may fail to start or may start with less memory than they had on the original node.&lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SQL SERVER 2005&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;To enable AWE for SQL Server 2005:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Run the SQL Server account under a Windows account with "Lock Pages in Memory" permissions assigned.&lt;/LI&gt;
&lt;LI&gt;Use sp_configure to set&amp;nbsp;"awe enabled" option to 1&lt;/LI&gt;
&lt;LI&gt;The "Maximize Data Throughput for Network Application" in Control Panel must be selected.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Support for AWE is available only in the SQL Server 2005 Enterprise, Standard and developer editions and only applies to 32-bit OS's. SQL Server 2005 Analysis Services (SSAS) cannot take advantage of AWE mapped memory. If available physical memory is less than the user mode VAS, AWE cannot be used.&lt;/P&gt;
&lt;P&gt;Lock pages in memory: Prevents paging the data to virtual memory or disk. Set to OFF by default in SQL Server 2005.&lt;/P&gt;
&lt;P&gt;SQL Server 2005 Enterprise Edition can access up to 64GB of memory on Windows 2000 and Windows Server 2003.&lt;/P&gt;
&lt;P&gt;Instances of SQL Server 2005 running on Windows 2000 use static AWE memory allocation, instances running on Windows Server 2003 use dynamic AWE memory allocation.&lt;/P&gt;
&lt;P&gt;To support over 4GB of physical memory, the /PAE switch must be added to boot.ini file. If more than 16GB of physical memory, the OS needs 2GB of virtual address space for system purposes and can therefore support only a 2GB user mode virtual address space. Remove /3GB from boot.ini file in order to use this memory above 16GB.&lt;/P&gt;
&lt;P&gt;The SQL Server buffer pool can fully utilise AWE mapped memory, however only database pages can be dynamically mapped to and unmapped from SQL Server's virtual address space and take full advantage of memory allocated through AWE.&lt;/P&gt;
&lt;P&gt;AWE does not directly help supporting additional users, threads, databases, queries and other objects that permanently reside in the virtual address space.&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx" target=_blank mce_href="http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx"&gt;SQL Server 2005 Features Comparison&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3055690" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/rob/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.technet.com/rob/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.technet.com/rob/archive/tags/Memory/default.aspx">Memory</category><category domain="http://blogs.technet.com/rob/archive/tags/2000/default.aspx">2000</category><category domain="http://blogs.technet.com/rob/archive/tags/2005/default.aspx">2005</category><category domain="http://blogs.technet.com/rob/archive/tags/32-bit/default.aspx">32-bit</category></item><item><title>Windows Memory (PAE/AWE/3GB)</title><link>http://blogs.technet.com/rob/archive/2008/05/15/windows-memory-and-sql-server.aspx</link><pubDate>Thu, 15 May 2008 15:20:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3055631</guid><dc:creator>robcarrol</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/rob/comments/3055631.aspx</comments><wfw:commentRss>http://blogs.technet.com/rob/commentrss.aspx?PostID=3055631</wfw:commentRss><description>&lt;P&gt;&lt;STRONG&gt;PAE (Physical Address Extension)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;PAE is the added ability of the IA32 processor to address more than 4GB of physical memory. The following OS's can use PAE to take advantage of physical memory beyond 4GB:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Microsoft Windows 2000 Advanced Server&lt;/LI&gt;
&lt;LI&gt;Microsoft Windows 2000&amp;nbsp;Datacentre Server&lt;/LI&gt;
&lt;LI&gt;Microsoft Windows Server&amp;nbsp;2003&amp;nbsp;Enterprise Edition&lt;/LI&gt;
&lt;LI&gt;Microsoft Windows Server&amp;nbsp;2003&amp;nbsp;Datacentre Edition&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;To enable PAE, use the /PAE switch in your server's boot.ini file.&lt;/P&gt;
&lt;P&gt;N.B. In Windows Server 2003, PAE is enabled automatically if your server is using hot-add memory devices.In all other cases, you must add the /PAE switch to boot.ini&lt;/P&gt;
&lt;P&gt;Typically, a process running under Windows 2000 or Windows 2003 can address up to 2GB of memory address space (3GB if the /3GB switch is used in boot.ini) with some of the memory being physical memory and some being virtual. The more programs (and therefore, more processes) you run, the more memory you commit up to the full 2GB of address space. When this occurs, the paging process increases dramatically and performance may be negatively affected.&lt;/P&gt;
&lt;P&gt;Windows 2000 and 2003 memory managers use PAE to provide more physical memory to a program. This reduces the need to swap the memory of the page file and results in increased performance. The program itself is not awareof the memory size, the memory management and allocation of the PAE memory is handled by the memory manager independently of the programs that run.&lt;/P&gt;
&lt;P&gt;When the /3GB switch is used is conjunction with the /PAE switch, the OS does not use any memory in excess of 16GB. This is caused by kernel virtual memory space considerations. If the system restarts with the /3GB switch in boot.ini, and the system has more than 16GB available (physical memory), the additional&amp;nbsp;RAM is not used by the OS. Restarting without the /3GB switch enables use of all the physical memory.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;AWE (Address Windowing Extensions)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;AWE is a set of API's to the memory manager's functionsthat enables programs to address more memory than is available through standard 32-bit addressing. It enables programs to reserve physical memory as non-paged memory to the program's working set of memory. Enables memory intensive programs, such as RDBMS, to reserve large amounts of physical memory for data without having to be paged in and out of a paging for for usage. Data is swapped in and out of of the working set and reserved memory is in excess of the 4GB range. Additionally, the range of memory in excess of 4GB is exposed to the memory manager and the AWE functions by PAE. Without PAE, AWE cannot reserve memory in excess of 4GB.&lt;/P&gt;
&lt;P&gt;In Summary:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PAE is a function of the Windows 2000 and Windows Server 2003 memory manager that provides more physical memory to a program that requests memory&lt;/LI&gt;
&lt;LI&gt;The program is not aware that any of the memory that it uses resides in the range greater than 4GB&lt;/LI&gt;
&lt;LI&gt;AWE is an API that enables programs to reserve large chunks of memory&lt;/LI&gt;
&lt;LI&gt;Reserved memory is non-pagable and is only accessible to that program&lt;/LI&gt;
&lt;LI&gt;You can't allocate more than 4GB of memory to an application on Windows Server 2000 because PAE is not available. Also cannot use the /3Gb switch in the boot.ini file with Windows Server 2000&lt;/LI&gt;
&lt;LI&gt;Need to use Windows 2000 Advanced Server or Windows 2000 Datacentre.&lt;/LI&gt;
&lt;LI&gt;PAE (36-bit physical addressing mode) allows up to 8GB of physical memory on Windows 2000 Advanced Server and 32GB on Windows 2000 Datacentre&lt;/LI&gt;
&lt;LI&gt;Maximum amount of memory supported on Windows Server 2003 is 4GB. Windows Server 2003 Enterprise Edition SP2&amp;nbsp;supports 64GB of physical RAM and Windows 2003 Datacentre&amp;nbsp;SP2&amp;nbsp;supports 128GB. You can use the /3GB switch in boot.ini in all versions of Windows Server 2003&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A class="" href="http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa366778(VS.85).aspx"&gt;Memory Limits for Windows Releases&lt;/A&gt;&lt;BR&gt;&lt;A class="" href="http://www.microsoft.com/whdc/system/platform/server/PAE/pae_os.mspx" mce_href="http://www.microsoft.com/whdc/system/platform/server/PAE/pae_os.mspx"&gt;Operating Systems and PAE support&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3055631" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/rob/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.technet.com/rob/archive/tags/Memory/default.aspx">Memory</category><category domain="http://blogs.technet.com/rob/archive/tags/32-bit/default.aspx">32-bit</category></item></channel></rss>