

This value can be queried via T-SQL using sys.dm_os_sys_memory.available_physical_memory_kb. Low values for the Available Bytes counter can indicate an overall shortage of operating system memory. This counter indicates how many bytes of memory are currently available for use by processes. Many operating system memory counters can be queried via the dynamic management views sys.dm_os_process_memory and sys.dm_os_sys_memory. To monitor for a low-memory condition, use the following Windows server counters.

In SQL Server on Linux, set the memory limit with the mssql-conf tool and the morylimitmb setting. For more information, see the Memory Management Architecture Guide. Use the max server memory option to limit the amount of memory that SQL Server is allowed to acquire for most of its uses. This is by design and does not indicate a memory leak in the SQL Server process. Once the memory is acquired, it will not be released unless memory pressure is detected.

Configuring SQL Server max memoryīy default, a SQL Server instance may over time consume most of the available Windows operating system memory in the server. Monitor an instance of SQL Server periodically to confirm that memory usage is within typical ranges.
