memory

  • I have some doubt regarding memory management.

    I have sql2005 on windows server 2003 ,64-bit

    suppose if have 32 gb of ram, by default how much memory it will take.

    As far i concerned by default os will take 2 gb of ram and remaining will be taken by the sql server as per demand.(but i think it will take not more than 2 gb)

    could any one tell me that sql serrver memory management is dynamic or not.what exactly happens

    Plz give some idea regarding memory management.

  • SQL and os will take the Memory as they needed. If you want to strict for SQL and OS, you may need to enable the AWE on SQL server side.

    Manoj

    MCP, MCTS (GDBA/EDA)

  • You are on 64 bit, so don't worry about AWE.

    By default, SQL server will dynamically allocate memory. This is configurable to a window of dynamic memory (set a min and max) or you can set it to allocate a specific amount of memory.

    SQL 2000 did not do an efficient job of dynamically allocating memory, but SQL 2005 does it rather well (MS made big improvements here).

    Every system is different. It is best to start with dynamic memory allocation and do some performance testing to see if you need to set limits or specify memory allocation manually.

  • Tend to agree with Michael. Monitor and observe the system. AWE isn't needed for 64-bit and my guess is SQL will keep building cache and run to 30GB unless you limit it.

  • To get the total current size of your buffer pool run the following:

    SELECT

    SUM( multi_pages_kb +

    virtual_memory_committed_kb +

    shared_memory_committed_kb +

    awe_allocated_kb ) AS [Used by BPool, KB]

    FROM

    sys.dm_os_memory_clerks

    WHERE

    [type] = 'MEMORYCLERK_SQLBUFFERPOOL'

    Taken from INSIDE MICROSOFT SQL SERVER 2005, QUERY TUNING AND OPTIMIZATION by Kalen Delaney at el., which contains a good discussion of memory issues.

    Another good tool is DBCC MEMORYSTATUS. It will give you the current size of the buffer pool, plus other components, such as the procedure cache.

    Here is an excerpt from the output run on my server:

    Buffer Counts Buffers

    ------------------------------ --------------------

    Committed 786432

    Target 786432

    Hashed 722004

    Stolen Potential 127447

    External Reservation 0

    Min Free 128

    Visible 195584

    Available Paging File 401426

    Procedure Cache Value

    ------------------------------ -----------

    TotalProcs 6878

    TotalPages 54239

    InUsePages 105

    In the above sample, the procedure cache size is 54239 pages times 8 KB/page = 434 MB (roughly)

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • Steve Jones - Editor (5/27/2008)


    Tend to agree with Michael. Monitor and observe the system. AWE isn't needed for 64-bit and my guess is SQL will keep building cache and run to 30GB unless you limit it.

    It's true that because of the vast amount of virtual address space available in 64-bit, the need for AWE is greatly diminished.

    However, memory allocated through AWE is locked in (will not get paged out), and that may be beneficial for app performance even in a 64-bit environment (albeit at the risk of starving other processes off of needed memory).

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • You need AWE to prevent memory stealing by the OS.

    Also make sure you have a minimum and maximum size. Don't set the maximum size to unlimited, or SQL will compete with your OS for the last MBs.

    We have the same configuration and our max memorysize is 28GB (min size is 16GB)

    Also, be aware of memory trashing if you do a large OS filecopy on that server.

    You also get memory messages in your logfile when adding/deleting databases/snapshots, but these are ok.

    Wilfred
    The best things in life are the simple things

  • I agree with Wilfred van Dijk. Wilfred van Dijk has explined very clearly.

    Manoj

    MCP, MCTS (GDBA/EDA)

  • Wilfred van Dijk (5/27/2008)


    You need AWE to prevent memory stealing by the OS.

    Also make sure you have a minimum and maximum size. Don't set the maximum size to unlimited, or SQL will compete with your OS for the last MBs.

    We have the same configuration and our max memorysize is 28GB (min size is 16GB)

    Also, be aware of memory trashing if you do a large OS filecopy on that server.

    You also get memory messages in your logfile when adding/deleting databases/snapshots, but these are ok.

    Memory stealing is not a concern, unless there are other non-OS essential apps running on the server, correct? (I'm thinking Exchange for example).

    Are there other occasions where mem stealing would be an issue?

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • If you don't enable AWE on a 64bit server you can get errors like "A significant part of sql server process memory has been paged out. This may result in performance degradation". for example, this can happen if you copy a lage filebackup to another server.

    As a result, al your SQL processes are suspending, but I would say dying (I've had that experience) :blush:

    Read the following articles:

    http://blogs.msdn.com/psssql/archive/2007/05/31/the-sql-server-working-set-message.aspx

    http://support.microsoft.com/kb/918483

    http://msmvps.com/blogs/omar/archive/2007/09/19/a-significant-part-of-sql-server-process-memory-has-been-paged-out-this-may-result-in-performance-degradation.aspx

    http://www.mcse.ms/message2444910.html

    http://blogs.msdn.com/slavao/archive/2005/04/29/413425.aspx

    Wilfred
    The best things in life are the simple things

  • Wilfred van Dijk (5/28/2008)


    If you don't enable AWE on a 64bit server you can get errors like "A significant part of sql server process memory has been paged out. This may result in performance degradation". for example, this can happen if you copy a lage filebackup to another server.

    As a result, al your SQL processes are suspending, but I would say dying (I've had that experience) :blush:

    Read the following articles:

    http://blogs.msdn.com/psssql/archive/2007/05/31/the-sql-server-working-set-message.aspx

    http://support.microsoft.com/kb/918483

    http://msmvps.com/blogs/omar/archive/2007/09/19/a-significant-part-of-sql-server-process-memory-has-been-paged-out-this-may-result-in-performance-degradation.aspx

    http://www.mcse.ms/message2444910.html

    http://blogs.msdn.com/slavao/archive/2005/04/29/413425.aspx

    I see your point.

    What percentage of physical memory should be apportioned to AWE use then?

    AWE benefits only the buffer cache, and we would need to ensure other operations, such as sorts, indexing, plan caching, the SQL CLR etc., have adequate memory.

    Also, there are some performance concerns regarding AWE in this link:

    http://download.microsoft.com/download/a/4/7/a47b7b0e-976d-4f49-b15d-f02ade638ebe/Adv64BitEnv.doc

    Although AWE makes execution of memory-intensive applications possible when otherwise impossible, AWE imposes overhead, adds initialization time, and can face performance challenges under various processing conditions. These issues are eliminated on the 64-bit platform when directly addressing memory.

    ...

    ...

    AWE does not increase Virtual Address Space

    A 32-bit system limits the virtual address space (the address space used by Windows to manage memory allocations) to 2 GB. Since AWE does not eliminate this virtual address space (VAS) limitation, many users try to raise the ceiling for this 32-bit limitation of only 2 GB of VAS by using the /3GB switch in the boot.ini file. This increases the VAS to 3 GB, thereby leaving only 1 GB for the operating system. This results in the reduction of the addressable physical memory of a single instance of Windows Server 2003 Enterprise and Datacenter editions to 16 GB. When not using the /3GB switch on Windows Server 2003 Enterprise Edition, the maximum memory addressable is 32 GB. For the Datacenter edition, it is 64 GB. This is because Windows requires more than 1 GB of VAS to manage more than 16 GB of total physical memory in one instance. So, using the switch may impose an artificial ceiling, thereby diminishing the capacity of your hardware and operating system.

    For all practical purposes, the use of AWE in a 32-bit environment is only for data caching. This is because data pages use relative addressing (a requirement for AWE usage), while other components do not. Consequently, other components, operating within a relatively small VAS of either 2 or 3 GB could be significantly blocked in larger systems that have complex workloads or many concurrent users even when running on high end servers with abundant memory.

    For example, the plan cache (cache of query plans) in SQL Server 2005 resides in the VAS. In cases of VAS memory pressure, query plans and execution contexts with costs of zero (0) are deleted from the plan cache. In high transaction environments, this could lead to poor performance due to the time and CPU resources that are needed to compile the query plans again. Conversely, on 64-bit systems, VAS is, for all practical purposes, unlimited. The result is faster performance because no additional time is taken up re-creating a query plan. This results in less CPU loading since the CPU is not working to compile a new plan as frequently. Such incidences can occur even on servers with large amounts of memory (such as 8 GB or more) because the plan cache (and other components except data pages) cannot take advantage of AWE memory.

    Another example of the limitations of AWE concerns support in SQL Server 2005 for the common language runtime (CLR). Although the CLR uses some memory allocations from the buffer pool (single-page allocator) where AWE is most useful, most SQL Operating System (SQLOS) memory allocations (multipage allocator) on behalf of the CLR are from the VAS. For customers who are considering more than moderate use of the CLR within SQL Server 2005, an additional reason to adopt 64-bit would be to prevent loss of performance from VAS memory pressure.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • Hi Everybody, eve ni have same issues with 32 Bit & 64 Bit Server. I'll come up clearly with issues in a day or two.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply