Script: Get Memory Configuration and Usage

This script shows how memory is configured for SQL Server and how much memory is currently being used. It helps confirm that instance-level memory settings are sensible and whether SQL Server or the host appears to be under memory pressure.

This is commonly checked during performance investigations, post-build validation, and when reviewing servers that are experiencing instability or unexpected resource contention.


The Script


Example Output

The result sets show configured minimum and maximum memory values, current SQL Server memory usage, and overall host memory availability. Together, these provide a quick view of whether SQL Server memory settings are appropriate and whether the system appears to be under memory pressure.

SQL Server query showing memory configuration and current memory usage

Notes

  • Useful for validating memory settings after server builds or migrations
  • Helps identify signs of internal or external memory pressure
  • Locked pages and large pages visibility depends on configuration and edition
  • Intended as a baseline check, not a tuning recommendation

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *