Select the product you need help with
There may not be enough virtual memory when you have a large number of databases in SQL ServerArticle ID: 316749 - View products that this article applies to. This article was previously published under Q316749 SYMPTOMS There may not be enough available virtual address space in
the Microsoft SQL Server process if all of the following conditions are true when you are
running SQL Server with the default configuration values:
Message 1Error: 17802, Severity: 18, State: 3 Could not create server event thread. Message 2
SQL Server could not spawn process_loginread thread. Message 3
WARNING: Clearing procedure cache to free contiguous memory.
Buffer Distribution: Stolen=3454 Free=2540 Procedures=138 Inram=0 Dirty=1108 Kept=35 I/O=0, Latched=0, Other=214821 Buffer Counts: Committed=222096 Target=222096 Hashed=215964 InternalReservation=547 ExternalReservation=0 Min Free=512 Procedure Cache: TotalProcs=8 TotalPages=138 InUsePages=138 Dynamic Memory Manager: Stolen=3556 OS=497 General=1706 Query Plan=755 Optimizer=0 Utilities=9 Connection=1583 Global Memory Objects: Resource=1119 Locks=163 XDES=1 SQLCache=90 Replication=5 LockBytes=2 ServerGlobal=20 Query Memory Manager: Grants=0 Waiting=0 Maximum=164370 Available=164370 CAUSE For each updated database, SQL Server allocates at least
one 64-KB block for use in formatting log records before they are written to
disk. This allocation occurs when the first log record is generated for the
database, such as during an INSERT, UPDATE, or DELETE statement. Depending on
the activity and the size of the generated log records, subsequent
modifications might trigger
the allocation
of additional
64-KB allocations. SQL Server 7.0 will allocate no
more than three 54-KB blocks.
In SQL Server 2000, the upper number of allocations for each database
is a function of the number of processors that SQL Server is configured to use.
WORKAROUND Use the -g startup parameter to leave additional, unreserved virtual memory
available for these database allocations. The -g parameter is documented in the Readme.txt of the SQL Server 7.0
service pack, and in SQL Server 2000 Books Online. The "More Information"
section in this article includes the settings that Microsoft recommends you use
to determine the appropriate value for this setting. MORE INFORMATION On a computer with 2 GB or more of RAM, SQL Server reserves
all but 256 MB (SQL Server 7.0) or 384 MB (SQL Server 2000) of virtual address
space during the startup process for use by the buffer pool. Additionally, to
storing the data and procedure cache, SQL Server uses the buffer pool memory to
service most other memory requests from SQL Server processes that are less than
8 KB. The remaining unreserved memory is intended for use with other
allocations that cannot be serviced from the buffer pool. These allocations
include, but are not limited to:
On systems that have a large number of databases, the
64-KB allocations that are required for log formatting might occupy all of the
remaining virtual memory. At that point, subsequent allocations may fail,
resulting in one or more of the errors that are listed in the "Symptoms"
section in this article. By using the -g startup parameter, you can instruct SQL Server to leave additional virtual memory available so that the combination of these log-related allocations and other normal allocations does not run out of virtual address space. The following table lists some suggested starting points for the -g value depending on the number of databases and the server version: Collapse this table
Microsoft recommends that you take serious consideration before you run a server with more databases than this because the overhead that is required for having this number of databases on the system is taking a lot of virtual memory away from the buffer pool, which may result in poor performance for the system as a whole. Additionally, creating lots of databases has the most significant effect on virtual memory. There are also per-database memory allocations that may cause a buffer pool out-of-memory condition. For example, you may receive the following error message: Error: 701, Severity: 17, State: 123.
There is insufficient system memory to run this query. When you track the index usage by using the sys.dm_db_index_usage_stats stored procedure, the operation may require a significant amount of memory. The operation requires a significant amount of memory if each database has lots of indexes. PropertiesArticle ID: 316749 - Last Review: February 28, 2007 - Revision: 11.1 APPLIES TO
| Article Translations
|


Back to the top








