SQL Server Memory Pool

In Microsoft® Windows NT® and Microsoft Windows® 95/98, the total amount of virtual memory available to an application forms the set of valid memory addresses for the application. The total virtual memory allocation for an application is known as its address space.

The Microsoft SQL Server™ address space has two main components, each of which has several subcomponents:

The size of the memory pool can be very dynamic, especially on computers running other applications. By default, SQL Server seeks to keep the amount of virtual memory allocations on the computer at 5 MB less than the physical memory. The only way SQL Server can do this is by varying the size of its address space. The only variable component in the SQL Server address space controlled by SQL Server is the memory pool. The other variable components in the SQL Server address space, such as the number and size of OLE DB providers, OLE Automation objects, and extended stored procedures, are all controlled by application requests. If an application executes a distributed query, SQL Server must load the associated OLE DB provider. This means that if a SQL Server component is loaded, or another application starts up, the only mechanism SQL Server can use to release the memory needed by the new component or application is to reduce the size of the memory pool. SQL Server administrators can set limits on how much the size of the buffer pool varies through the min server memory and max server memory configuration options.

The regions within the memory pool are also highly dynamic. The SQL Server code constantly adjusts the amounts of the memory pool assigned to the various areas to optimize performance. Within the memory pool, the areas used to store connection context and system data structures are controlled by user requests. As new connections are made, SQL Server has to allocate data structures to store their context. As new databases are defined, SQL Server has to allocate data structures to define the attributes of the database. As tables and views are referenced, SQL Server allocates data structures describing their structure and attributes. This leaves the buffer cache, procedure cache, and log caches as the memory units whose size is controlled by SQL Server. SQL Server adjusts the sizes of these areas dynamically as needed to optimize performance.

For more information about the sizes of the various system and connection context data structures, see Memory Used by SQL Server Objects Specifications. SQL Server 7.0 is very efficient in the way it stores the context and state information for each connection, typically using less than 24 KB for each connection.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.