I’ve often got SQL Server running on my workstation, laptop or VPC and find that it just soaks up all my memory. This script sets the maximum limit:
USE [master] GO -- Set max server memory limit EXEC sp_configure 'show advanced options', 1 RECONFIGURE WITH OVERRIDE EXEC sp_configure 'max server memory (MB)', 484 RECONFIGURE WITH OVERRIDE -- Check the setting EXEC sp_configure 'max server memory (MB)'
USE [master]
GO
-- Set max server memory limit
EXEC sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
EXEC sp_configure 'max server memory (MB)', 484
-- Check the setting
EXEC sp_configure 'max server memory (MB)'