How to adjust memory usage by using configuration options in SQL Server (321363)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 7.0
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Workgroup

This article was previously published under Q321363

SUMMARY

When you start SQL Server, SQL Server memory usage may continue to steadily increase and not decrease, even when activity on the server is low. Additionally, the Task Manager and Performance Monitor may show that the physical memory available on the computer is steadily decreasing until the available memory is between 4 to 10 MB.

This behavior alone does not indicate a memory leak. This behavior is normal and is an intended behavior of the SQL Server buffer pool.

By default, SQL Server dynamically grows and shrinks the size of its buffer pool (cache) depending on the physical memory load reported by the operating system. As long as enough memory is available to prevent paging (between 4 - 10 MB), the SQL Server buffer pool will continue to grow. As other processes on the same computer as SQL Server allocate memory, the SQL Server buffer manager will release memory as needed. SQL Server can free and acquire several megabytes of memory each second, allowing it to quickly adjust to memory allocation changes.

MORE INFORMATION

You can establish upper and lower limits to the amount of memory (buffer pool) used by the SQL Server database engine with the min server memory and max server memory configuration options. Before you set the min server memory and max server memory options, review the references in the section titled "Memory" in the following Microsoft Knowledge Base article:

319942 HOW TO: Determine Proper SQL Server Configuration Settings

Note that the max server memory option only limits the size of the SQL Server buffer pool. The max server memory option does not limit a remaining unreserved memory area that SQL Server leaves for allocations of other components such as extended stored procedures, COM objects, non-shared DLLs, EXEs, and MAPI components. Because of the preceding allocations, it is normal for the SQL Server private bytes to exceed the max server memory configuration. For additional information about allocations from this unreserved memory area, click the article number below to view the article in the Microsoft Knowledge Base:

316749 PRB: There May Not Be Enough Virtual Memory with Large Number of Databases

REFERENCES

SQL Server Books Online; topics: "Effects of min and max server memory"; "Memory Architecture"; "Memory Architecture"; "Server Memory Options"; "SQL Server Memory Pool"

For more information about the min server memory configuration option and the max server memory configuration option in SQL Server 2005, see the "Effects of min and max server memory" topic in SQL Server 2005 Books Online.

Modification Type:MajorLast Reviewed:12/23/2005
Keywords:kbinfo KB321363