SQL server memory issue

Devendra Kumar Sahu 236 Reputation points
2021-09-18T12:09:20.157+00:00

I am using SQL Server 2016 SE. When I used Update statistics Maintenance plan , the SQL server memory go on increasing & it will never come down. Maintenance plan successfully completed but it not come down memory . Can anybody suggest how to release memory from sql server.

Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,638 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 100.8K Reputation points MVP
    2021-09-18T13:12:40.337+00:00

    You don't want to release memory from SQL Server, period.

    SQL Server is designed to grab as much memory as it can. It reads the data into the buffer cache, as reading from cache is faster than reading from disk. Once it has read data into cache, what would be the point with throwing that memory away, as long as it is not needed for anything else?

    If there other processes running on the machine and there is memory pressure, SQL Server will yield memory, don't worry.

    Although, sometimes SQL Server may not yield fast enough, and if other processes are suffering, you can set "max server memory" to limit how much memory SQL Server can consume. For instance, if you are running SQL Server on your laptop, where there are lot of other things going, you may want to run

    EXEC sp_configure 'max server memory', 4000
    RECONFIGURE
    

    to cap SQL Server at 4GB of memory. But don't do this on a production server which is dedicated to run SQL Server.


2 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 100.8K Reputation points MVP
    2021-09-18T13:41:18.583+00:00

    So everything is perfectly normal then. Just roll over to the other side and fall back into sleep.


  2. YufeiShao-msft 7,051 Reputation points
    2021-09-20T06:56:20.367+00:00

    Hi @Devendra Kumar Sahu

    It is quite normal for SQL Server to utilize memory allocated to it which often seems like it is using high memory. SQL Server always assumes it is the primary application running, it will always take all the available memory and it will only release it for the operating system, so you can set ‘max server memory’

    0 comments No comments