|
| 1 | +--- |
| 2 | +title: "sys.dm_os_linux_vm_stats (Transact-SQL)" |
| 3 | +description: sys.dm_os_linux_vm_stats returns a table with detailed Linux CPU statistics, offering system-level insights beyond SQL Server. |
| 4 | +author: rwestMSFT |
| 5 | +ms.author: randolphwest |
| 6 | +ms.date: 01/19/2026 |
| 7 | +ms.service: sql |
| 8 | +ms.subservice: system-objects |
| 9 | +ms.topic: "reference" |
| 10 | +f1_keywords: |
| 11 | + - "dm_os_linux_vm_stats" |
| 12 | + - "sys.dm_os_linux_vm_stats_TSQL" |
| 13 | + - "dm_os_linux_vm_stats_TSQL" |
| 14 | + - "sys.dm_os_linux_vm_stats" |
| 15 | +helpviewer_keywords: |
| 16 | + - "sys.dm_os_linux_vm_stats dynamic management view" |
| 17 | +dev_langs: |
| 18 | + - "TSQL" |
| 19 | +--- |
| 20 | +# sys.dm_os_linux_vm_stats (Transact-SQL) |
| 21 | + |
| 22 | +[!INCLUDE [sqlserver2025-linux](../../includes/applies-to-version/sqlserver2025-linux.md)] |
| 23 | + |
| 24 | +Returns Linux operating system-level virtual memory statistics, including metrics related to SQL Server and other processes running on the system, in [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)] Cumulative Update (CU) 1 and later versions. |
| 25 | + |
| 26 | +| Column name | Data type | Nullable | Description | |
| 27 | +| --- | --- | --- | --- | |
| 28 | +| `vm_metric_name` | **nvarchar(256)** | No | Virtual memory metric name. | |
| 29 | +| `count` | **bigint** | No | Corresponding statistic for that metric. | |
| 30 | + |
| 31 | +## Permissions |
| 32 | + |
| 33 | +Requires `VIEW SERVER PERFORMANCE STATE` permission on the server. |
| 34 | + |
| 35 | +## Remarks |
| 36 | + |
| 37 | +`sys.dm_os_linux_vm_stats` provides system-wide memory observability to help you analyze memory pressure, page faults, reclaim activity, non-uniform memory access (NUMA) behavior, and to correlate SQL Server performance with overall OS memory health. |
| 38 | + |
| 39 | +Each row represents a single virtual memory metric, typically sourced from Linux interfaces such as `/proc/vmstat`. Metric availability and meaning can vary by Linux distribution, kernel version, and configuration. |
| 40 | + |
| 41 | +Use this DMV with other Linux-specific DMVs for holistic monitoring: |
| 42 | + |
| 43 | +- [sys.dm_os_linux_cpu_stats](sys-dm-os-linux-cpu-stats-transact-sql.md) |
| 44 | +- [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md) |
| 45 | +- [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md) |
| 46 | + |
| 47 | +### Usage scenarios |
| 48 | + |
| 49 | +Common scenarios for using `sys.dm_os_linux_vm_stats` include: |
| 50 | + |
| 51 | +- Investigating out-of-memory (OOM) events on Linux hosts. |
| 52 | +- Correlating SQL Server memory symptoms with OS reclaim activity. |
| 53 | +- Understanding NUMA-related memory behavior on multinode systems. |
| 54 | +- Performing deep OS-level observability directly from Transact-SQL. |
| 55 | + |
| 56 | +## Examples |
| 57 | + |
| 58 | +### A. View all virtual memory statistics |
| 59 | + |
| 60 | +The following query returns all available virtual memory metrics reported by the Linux kernel: |
| 61 | + |
| 62 | +```sql |
| 63 | +SELECT * |
| 64 | +FROM sys.dm_os_linux_vm_stats; |
| 65 | +``` |
| 66 | + |
| 67 | +### B. Identify page fault activity |
| 68 | + |
| 69 | +The following query highlights page fault-related metrics, which can help identify memory pressure or inefficient memory access patterns: |
| 70 | + |
| 71 | +```sql |
| 72 | +SELECT vm_metric_name, |
| 73 | + count |
| 74 | +FROM sys.dm_os_linux_vm_stats |
| 75 | +WHERE vm_metric_name IN ('pgfault', 'pgmajfault'); |
| 76 | +``` |
| 77 | + |
| 78 | +### C. Monitor locality of NUMA memory |
| 79 | + |
| 80 | +Returns NUMA-related virtual memory metrics to help understand memory locality across nodes: |
| 81 | + |
| 82 | +```sql |
| 83 | +SELECT vm_metric_name, |
| 84 | + count |
| 85 | +FROM sys.dm_os_linux_vm_stats |
| 86 | +WHERE vm_metric_name LIKE 'numa%'; |
| 87 | +``` |
| 88 | + |
| 89 | +### D. Analyze activity for memory reclaim and compaction |
| 90 | + |
| 91 | +The following query helps you diagnose memory reclaim behavior and compaction pressure on the system: |
| 92 | + |
| 93 | +```sql |
| 94 | +SELECT vm_metric_name, |
| 95 | + count |
| 96 | +FROM sys.dm_os_linux_vm_stats |
| 97 | +WHERE vm_metric_name LIKE 'pgsteal%' |
| 98 | + OR vm_metric_name LIKE 'pgscan%' |
| 99 | + OR vm_metric_name LIKE 'compact%'; |
| 100 | +``` |
| 101 | + |
| 102 | +## Related content |
| 103 | + |
| 104 | +- [sys.dm_os_linux_cpu_stats (Transact-SQL)](sys-dm-os-linux-cpu-stats-transact-sql.md) |
| 105 | +- [sys.dm_os_linux_disk_stats (Transact-SQL)](sys-dm-os-linux-disk-stats-transact-sql.md) |
| 106 | +- [sys.dm_os_linux_net_stats (Transact-SQL)](sys-dm-os-linux-net-stats-transact-sql.md) |
| 107 | +- [Performance best practices and configuration guidelines for SQL Server on Linux](../../linux/sql-server-linux-performance-best-practices.md) |
0 commit comments