- Error number
- 17803
- Severity
- 20 (fatal: the connection ends; may indicate a serious problem)
- State
- Not documented by Microsoft (not reproduced here)
- Product
- Microsoft SQL Server Database Engine
- Versions
- All supported SQL Server versions (2016 to 2025), Azure SQL Managed Instance
- Category
- Memory
- Last reviewed
- 24 October 2026
On this page
What it means
Error 17803 means SQL Server could not allocate the small amount of memory it needs to set up a new connection, so it closed that connection; the instance as a whole is short of memory.
Each new connection needs memory for its session structures and network buffers before login can finish. When that allocation fails, SQL Server closes the connection with 17803, and the client sees its connection attempt fail. Microsoft's explanation is simply that the server is running out of memory, and the action is to find out why. The connection that failed is a symptom, not the cause.
The catalogue severity is 20, which marks a problem with the connection being set up rather than with a database. Because it appears before any query runs, 17803 often shows up together with other memory errors such as 701 or 802. Look at memory at the time of the error: what Windows had available, what SQL Server was using, and which internal component had grown.
Common causes
- Pressure from outside SQL Server: other services or applications on the same machine, or a virtual machine whose memory is overcommitted, leaving Windows little to give.
- Max server memory left at its default on a server shared with other workloads, so SQL Server and the operating system compete for the same RAM.
- One engine component using far more memory than usual (large query memory grants, a bloated plan cache, the lock manager).
- Memory used inside the SQL Server process but outside the buffer pool, for example by linked server providers, SQLCLR or third-party DLLs.
- A storm of new connections (for example after an application restart) arriving while memory is already tight.
Diagnose it
Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.
Is Windows short of memory?
SELECT total_physical_memory_kb / 1024 AS total_mb,
available_physical_memory_kb / 1024 AS available_mb,
available_page_file_kb / 1024 AS available_page_file_mb,
system_memory_state_desc
FROM sys.dm_os_sys_memory; Available physical memory is low or very little available memory compared with the total points to pressure from outside SQL Server.
Is the SQL Server process itself low on memory?
SELECT physical_memory_in_use_kb / 1024 AS in_use_mb,
memory_utilization_percentage,
process_physical_memory_low, process_virtual_memory_low
FROM sys.dm_os_process_memory;
SELECT committed_kb / 1024 AS committed_mb,
committed_target_kb / 1024 AS target_mb
FROM sys.dm_os_sys_info; process_physical_memory_low = 1 or process_virtual_memory_low = 1 confirms the process is under memory pressure. committed_mb at target_mb means SQL Server has reached the memory it is allowed to use.
Which memory clerks are the largest?
SELECT TOP (15) type, name,
pages_kb / 1024 AS pages_mb,
virtual_memory_committed_kb / 1024 AS vm_committed_mb
FROM sys.dm_os_memory_clerks
ORDER BY pages_kb DESC; The buffer pool clerk is normally the largest. Another clerk far above its usual size is the component to investigate.
Did SQL Server record out-of-memory events?
SELECT event_time, oom_cause_desc, available_physical_memory_mb,
top_memory_clerks
FROM sys.dm_os_out_of_memory_events
ORDER BY event_time DESC; On SQL Server 2022 and later, events near the time of the 17803 messages with a predicted cause. Microsoft describes the cause as a heuristic, so confirm it with the other checks.
How are memory limits configured?
SELECT name, value_in_use
FROM sys.configurations
WHERE name IN (N'max server memory (MB)', N'min server memory (MB)'); A max server memory of 2147483647 is the default (no limit), which on a shared server can leave Windows and other processes short.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Remove the memory pressure from outside SQL Server
Client or network sideIf diagnostic 1 shows Windows short of memory, find the other processes using RAM (Task Manager or Performance Monitor, Process: Working Set) and stop, move or limit them. On a virtual machine, check that its memory is reserved and not ballooned or overcommitted. This is the "reduce nonessential memory load" part of the message.
Reduce what the largest internal consumer uses
Client or network sideIf one clerk has grown, act on it: tune queries with large memory grants, parameterise ad hoc queries that fill the plan cache, shorten transactions that hold many locks, and move linked server providers or other components out of the SQL Server process where possible. Spread application start-up so that thousands of connections are not opened at the same moment.
Set max server memory from measurements, or add memory
Changes configurationIf max server memory is unset on a server that also runs other workloads, choose a value that leaves enough for Windows and the other processes, based on what diagnostics 1 and 2 show. If the workload simply needs more memory than the server has, the lasting fix is more RAM, which is the "increase system memory" part of the message.
Caution: sp_configure and RECONFIGURE change the whole instance at once. Too low a value starves the buffer pool and slows every database; too high starves Windows. Record the old value so you can revert.
-- Only with a value chosen from measurements (example: 28 GB on a 32 GB server)
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'max server memory (MB)', 28672;
RECONFIGURE;
Examples
A new connection is closed while the server is out of memory
Shown as documented by Microsoft; not reproduced here, because it needs real memory exhaustion on the instance. The message text is from sys.messages on SQL Server 2025; the level and state recorded at the time were not observed, so no header is shown.
-- Any new connection, for example
sqlcmd -S ServerName -E -Q "SELECT 1"
There was a memory allocation failure during connection establishment. Reduce nonessential memory load, or increase system memory. The connection has been closed.
How to prevent it
Size the server for its workload and leave headroom for Windows and anything else that runs on it. Set max server memory deliberately on servers that share RAM with other services, and revisit it when the workload or hardware changes.
Monitor available memory, the largest memory clerks and the rate of new connections, so that growing pressure is visible before connections start failing. Connection pooling in the applications also reduces how often new connections have to be set up.
Common questions
Is 17803 a connection problem or a memory problem?
A memory problem that shows up at connection time. Network checks will not help; look at memory on the server when the messages appear.
Do existing sessions keep working?
The message closes only the new connection. If memory stays short, existing sessions may start to fail with other memory errors such as 701, so act on the cause quickly.
Learn more on CodeWithSQL
Official documentation
- MSSQLSERVER_17803 (Microsoft Learn)
- Troubleshoot out of memory or low memory issues in SQL Server
- Server memory configuration options
- sys.dm_os_sys_memory
Last technically reviewed 24 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.