question

AntonyMaxwin-4065 avatar image
0 Votes"
AntonyMaxwin-4065 asked ErlandSommarskog answered

SQL Using More memory

Hi
i have 128 GB Memory in SQL Server, But twice a day i need to restart the Server for releasing memory that used by SQL, if The first day SQL uses 40 GB, then the Second day it reaches to 75 to 80 GB, it affect the performance. Is there any way that i can release memory without restarting.

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered

In addition to the other posts: if you are seeing performance issues, they are not due to the memory consumption. Rather, by re-starting SQL Server that frequently, you are making matters worse since data has to be read for disk instead from the cache. So stop doing that.

Poor performance is usually due to bad queries and/or poor indexing. Possibly the high memory consumption is due to poorly performing queries.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Criszhan-msft avatar image
0 Votes"
Criszhan-msft answered

Hi,

By default, the settings in SQL Server allow it to use as much memory as possible on the server. If necessary, you can set a limit (max server memory). as follows.
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-memory-server-configuration-options?view=sql-server-ver15

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OlafHelper-2800 avatar image
1 Vote"
OlafHelper-2800 answered

It's by design that SQL Server allocate as much memory as it needs and as it can get. Once allocated it release memory only on OS preasure.

Is this a server decicated for SQL Server? Then the memory usage should be an issue. Use Min/Max memory setting to keep some memory left for the OS, see Server memory configuration options

What for perfomance problems do you mean? Hardly cause by SQL Server uses to "much" memory.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.