Task Manager shows sqlservr.exe using 95% of the server's RAM. Someone restarts the service, memory drops, and a day later it's back at 95%. Is SQL Server leaking memory?
Almost certainly not. Taking the memory is by design. Leaving it unlimited is the mistake.
Why SQL Server takes all the memory
SQL Server caches data pages in the buffer pool. Reading a page from memory is thousands of times faster than reading it from disk, so SQL Server keeps every page it reads for as long as it can and grows the cache until it hits a limit. It deliberately doesn't give memory back just because it's idle; that memory is the cache.
The limit is max server memory, and its default is 2147483647 MB. In other words, all of it. On a dedicated database server that's close to what you want, but without a limit, SQL Server can squeeze the operating system, backup agents, antivirus and anything else on the box until Windows starts paging. That's when performance collapses.
Restarting "fixes" it only because it empties the cache. Every query then reads from disk until the cache warms up again. Please don't schedule restarts.
Set max server memory
Current guidance from Microsoft (updated in 2025) is a sensible starting point: about 75% of the memory not used by other processes, and leave min server memory at its default of 0 unless you have a specific reason.
| Server RAM | Starting max server memory |
|---|---|
| 16 GB | ~12 GB |
| 64 GB | ~48–52 GB |
| 256 GB | ~200–220 GB |
On larger servers you can move toward leaving a fixed amount (for example 8–16 GB) for the OS rather than a flat 25%. The setup program has suggested a value since SQL Server 2019.
EXEC sys.sp_configure N'show advanced options', 1;
RECONFIGURE;
EXEC sys.sp_configure N'max server memory (MB)', ;
RECONFIGURE;
