I am using SQL Server 2014 Developer edition.
SQL Server is running on server and it's occupied around 60 GB memory while execution and after completion of execution it's not releasing it.
Please suggest on this.
I want to reduce it to normal.
I am using SQL Server 2014 Developer edition.
SQL Server is running on server and it's occupied around 60 GB memory while execution and after completion of execution it's not releasing it.
Please suggest on this.
I want to reduce it to normal.
It's common for SQL server to have several instances on a machine which is not a dedicated SQL server machine, but where SQL Server embedded or LocalDB is installed as part of an operating system component or as part of an application.
In these circumstances it is appropriate to allocate memory to each instance so they don't tread on each other's toes.
In addition, some applications make heavy use both of a database as well as memory and processor intensive application processing. Where there is a lot of transfer to and from the database it can make sense to locate the DB on the same machine as the application to reduce the IO cost, as they can then use a shared memory connection. In this case, again, you will have to allocate how much memory SQL server is allowed to use.
Development machines are a perfect example of this - typically you will have an installation of SQL Server development edition, and in addition to that any database projects will spin up an instance of SQL Server LocalDB.
For your Dev machine you want to keep this value relatively low. I’d suggest 512 MB, but if you feel that’s too low 1024 MB shouldn’t be a problem
To reduce SQL Server memory usage you can run the following SQL:
EXEC sys.sp_configure N'show advanced options', N'1' ;
RECONFIGURE WITH OVERRIDE;
EXEC sys.sp_configure N'max server memory (MB)', N'512';
RECONFIGURE WITH OVERRIDE;
EXEC sys.sp_configure N'show advanced options', N'0';
RECONFIGURE WITH OVERRIDE;
Reducing usage of the LocalDB instances is similar, you simply have to connect to each LocalDB instance and use the same commands.
For example, to set all LocalDB instances to use at most 256MB:
$MaxServerMemory = 256
@( & sqllocaldb info ) | %{
"Reconfiguring (LocalDB)\$_"
& sqlcmd.exe -E -S "(LocalDB)\$_" -Q "EXEC sys.sp_configure N'show advanced options', N'1' ;RECONFIGURE WITH OVERRIDE;EXEC sys.sp_configure N'max server memory (MB)', N'$MaxServerMemory';RECONFIGURE WITH OVERRIDE;EXEC sys.sp_configure N'show advanced options', N'0'; RECONFIGURE WITH OVERRIDE;" *>&1
""
}