Skip to content

Commit ad31f9b

Browse files
Merge pull request #21016 from WilliamDAssafMSFT/20220114-supportability-oom
20220114 1722 oom supportability objects
2 parents 1c18240 + bbba0f3 commit ad31f9b

4 files changed

Lines changed: 99 additions & 8 deletions

File tree

docs/relational-databases/system-catalog-views/sys-resource-stats-azure-sql-database.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
description: "sys.resource_stats (Azure SQL Database)"
2+
description: "sys.resource_stats returns CPU usage and storage data for an Azure SQL Database. "
33
title: "sys.resource_stats (Azure SQL Database)"
44
ms.custom: ""
5-
ms.date: "08/19/2021"
5+
ms.date: "03/09/2022"
66
ms.service: sql-database
77
ms.topic: "reference"
88
f1_keywords:
@@ -45,7 +45,7 @@ monikerRange: "=azuresqldb-current"
4545
|max_worker_percent|**decimal(5,2)**|Maximum concurrent workers (requests) in percentage based on the limit of the database's service tier.<br /><br /> Maximum is currently calculated for the five-minute interval based on the 15-second samples of concurrent worker counts.|
4646
|max_session_percent|**decimal(5,2)**|Maximum concurrent sessions in percentage based on the limit of the database's service tier.<br /><br /> Maximum is currently calculated for the five-minute interval based on the 15-second samples of concurrent session counts.|
4747
|dtu_limit|**int**|Current max database DTU setting for this database during this interval. |
48-
|xtp_storage_percent|**decimal (5,2)**|Storage utilization for In-Memory OLTP in percentage of the limit of the service tier (at the end of the reporting interval). This includes memory used for storage of the following In-Memory OLTP objects: memory-optimized tables, indexes, and table variables. It also includes memory used for processing ALTER TABLE operations.<br /><br /> Returns 0 if In-Memory OLTP is not used in the database.|
48+
|xtp_storage_percent|**decimal (5,2)**|Storage utilization for In-Memory OLTP in percentage of the limit of the service tier (at the end of the reporting interval). This includes memory used for storage of the following In-Memory OLTP objects: memory-optimized tables, indexes, and table variables. It also includes memory used for processing ALTER TABLE operations. For more information, see [Monitor In-Memory OLTP](/azure/azure-sql/in-memory-oltp-monitor-space).<br /><br /> Returns 0 if In-Memory OLTP is not used in the database.|
4949
|avg_login_rate_percent|**decimal (5,2)**|Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.|
5050
|avg_instance_cpu_percent|**decimal (5,2)**|Average database CPU usage as a percentage of the SQL Database process.|
5151
|avg_instance_memory_percent|**decimal (5,2)**|Average database memory usage as a percentage of the SQL Database process.|
@@ -68,6 +68,8 @@ monikerRange: "=azuresqldb-current"
6868
> [!NOTE]
6969
> For more information on troubleshooting CPU utilization using dynamic management views, see [Identify CPU performance issues in Microsoft Azure SQL Database and Azure SQL Managed Instance performance](/azure/azure-sql/database/monitoring-with-dmvs#identify-cpu-performance-issues).
7070
71+
To review recent out of memory events, use [sys.dm_os_out_of_memory_events](../system-dynamic-management-views/sys-dm-os-out-of-memory-events.md).
72+
7173
## Examples
7274

7375
On Azure SQL Database, you must be connected to the `master` database to query `sys.resource_stats` in the following examples.
@@ -86,8 +88,13 @@ GROUP BY database_name
8688
HAVING AVG(avg_cpu_percent) >= 80;
8789
```
8890

89-
## See Also
91+
## See also
92+
9093
- [Service Tiers](/azure/azure-sql/database/purchasing-models)
9194
- [Service tier capabilities and limits](/azure/azure-sql/database/performance-guidance)
95+
- [sys.dm_os_out_of_memory_events (Azure SQL Database and Azure SQL Managed Instance)](../system-dynamic-management-views/sys-dm-os-out-of-memory-events.md)
96+
97+
## Next steps
98+
9299
- [Monitoring Microsoft Azure SQL Database and Azure SQL Managed Instance performance using dynamic management views](/azure/azure-sql/database/monitoring-with-dmvs)
93100
- [Monitoring and performance tuning in Azure SQL Database and Azure SQL Managed Instance](/azure/azure-sql/database/monitor-tune-overview)

docs/relational-databases/system-catalog-views/sys-server-resource-stats-azure-sql-database.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
description: "sys.server_resource_stats (Azure SQL Managed Instance)"
2+
description: "sys.server_resource_stats returns CPU usage, IO, and storage data for Azure SQL Managed Instance."
33
title: "sys.server_resource_stats (Azure SQL Managed Instance)"
44
ms.custom: ""
5-
ms.date: "08/19/2021"
5+
ms.date: "03/09/2022"
66
ms.service: sql-database
77
ms.topic: "reference"
88
f1_keywords:
@@ -58,7 +58,7 @@ The following table describes the columns available:
5858
Querying a dynamic management view requires **VIEW SERVER STATE** permissions.
5959

6060
## Remarks
61-
The data returned by `sys.server_resource_stats` are expressed as the total used in either bytes or megabytes (stated in column names) other than avg_cpu, which is expressed as a percentage of the maximum allowed limits for the service tier/performance level that you are running.
61+
The data returned by `sys.server_resource_stats` are expressed as the total used in either bytes or megabytes (stated in column names) other than `avg_cpu`, which is expressed as a percentage of the maximum allowed limits for the service tier/performance level that you are running.
6262

6363
> [!NOTE]
6464
> For more information on troubleshooting CPU utilization using dynamic management views, see [Identify CPU performance issues in Microsoft Azure SQL Database and Azure SQL Managed Instance performance](/azure/azure-sql/database/monitoring-with-dmvs#identify-cpu-performance-issues).
@@ -77,7 +77,11 @@ WHERE start_time BETWEEN @s AND @e;
7777
GO
7878
```
7979

80-
## See Also
80+
## See also
8181
- [Managed Instance Compute Hardware in the vCore Service Tier](/azure/azure-sql/managed-instance/service-tiers-managed-instance-vcore)
8282
- [Managed Instance Resource Limits](/azure/azure-sql/managed-instance/resource-limits)
83+
- [sys.dm_os_out_of_memory_events (Azure SQL Database and Azure SQL Managed Instance)](../system-dynamic-management-views/sys-dm-os-out-of-memory-events.md)
84+
85+
## Next steps
8386
- [Monitoring and performance tuning in Azure SQL Database and Azure SQL Managed Instance](/azure/azure-sql/database/monitor-tune-overview)
87+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
description: "sys.dm_os_out_of_memory_events returns a log of out of memory (OOM) events, including a predicted out of memory cause."
3+
title: "sys.dm_os_out_of_memory_events"
4+
ms.custom: ""
5+
ms.date: "03/10/2022"
6+
ms.service: sql-database
7+
ms.topic: "reference"
8+
f1_keywords:
9+
- "sys.dm_os_out_of_memory_events"
10+
- "sys.dm_os_out_of_memory_events_TSQL"
11+
- "dm_os_out_of_memory_events"
12+
- "dm_os_out_of_memory_events_TSQL"
13+
dev_langs:
14+
- "TSQL"
15+
helpviewer_keywords:
16+
- "sys.dm_os_out_of_memory_events"
17+
- "dm_os_out_of_memory_events"
18+
author: WilliamDAssafMSFT
19+
ms.author: wiassaf
20+
ms.reviewer:
21+
monikerRange: "=azuresqldb-current||=azuresqldb-mi-current"
22+
---
23+
# sys.dm_os_out_of_memory_events
24+
25+
[!INCLUDE[Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/asdb-asdbmi.md)]
26+
27+
Returns a log of out of memory (OOM) events.
28+
29+
For more information on out of memory conditions in [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)], see [Troubleshoot out of memory errors in Azure SQL Database](/azure/azure-sql/database/troubleshoot-memory-errors-issues).
30+
31+
|Column Name|Data Type|Description|
32+
|-------------|---------------|-----------------|
33+
|event_time | datetime2, not null | OOM event time |
34+
|oom_cause | tinyint, not null | A numeric value indicating OOM root cause. OOM cause is determined by a heuristic algorithm and is provided with a finite degree of confidence. |
35+
|oom_cause_desc | nvarchar(60), not null | Description of `oom_cause`, one of:<BR>0. UNKNOWN - OOM cause could not be determined<BR>1. HEKATON_POOL_MEMORY_LOW - Insufficient memory in the resource pool used for In-Memory OLTP. For more information, see [Monitor In-Memory OLTP](/azure/azure-sql/in-memory-oltp-monitor-space).<BR>2. MEMORY_LOW - Insufficient memory available to the database engine process<BR>3. OS_MEMORY_PRESSURE - OOM due to external memory pressure from the operating system<BR>4. OS_MEMORY_PRESSURE_SQL - OOM due to external memory pressure from other database engine instance(s)<BR>5. NON_SOS_MEMORY_LEAK - OOM due to a leak in non-SOS memory, for example, loaded modules<BR>6. SERVERLESS_MEMORY_RECLAMATION - OOM related to memory reclamation in a serverless database<BR>7. MEMORY_LEAK - OOM due to a leak in SOS memory<BR>8. SLOW_BUFFER_POOL_SHRINK - OOM due to the buffer pool not releasing memory fast enough under memory pressure<BR>9. INTERNAL_POOL - Insufficient memory in the internal resource pool<BR>10. SYSTEM_POOL - Insufficient memory in a system resource pool<BR>11. QUERY_MEMORY_GRANTS - OOM due to large memory grants held by queries<BR>12. REPLICAS_AND_AVAILABILITY - OOM due to workloads in SloSecSharedPool resource pool |
36+
|available_physical_memory_mb|int, not null|Available physical memory, in megabytes|
37+
|initial_job_object_memory_limit_mb |int, null |Job object memory limit on database engine startup, in megabytes. For more information on Job Objects, see [Resource governance](/azure/azure-sql/database/resource-limits-logical-server#resource-governance). |
38+
|current_job_object_memory_limit_mb |int, null |Job object current memory limit, in megabytes |
39+
|process_memory_usage_mb |int, not null |Total process memory usage in megabytes by the instance |
40+
|non_sos_memory_usage_mb |int, not null | Non-SOS usage in megabytes, including SOS created threads, threads created by non-SOS components, loaded DLLs, etc.|
41+
|committed_memory_target_mb |int, not null |SOS target memory in megabytes |
42+
|committed_memory_mb |int, not null |SOS committed memory in megabytes |
43+
|allocation_potential_memory_mb |int, not null |Memory available to the database engine instance for new allocations, in megabytes |
44+
|oom_factor |tinyint, not null | A value that provides additional information related to the OOM event, for internal use only|
45+
|oom_factor_desc |nvarchar(60), not null |Description of `oom_factor`. For internal use only. One of:<BR>0 - UNDEFINED<BR>1 - ALLOCATION_POTENTIAL<BR>2 - BLOCK_ALLOCATOR<BR>3 - ESCAPE_TIMEOUT<BR>4 - FAIL_FAST<BR>5 - MEMORY_POOL<BR>6 - EMERGENCY_ALLOCATOR<BR>7 - VIRTUAL_ALLOC<BR>8 - SIMULATED<BR>9 - BUF_ALLOCATOR<BR>10 - QUERY_MEM_QUEUE<BR>11 - FRAGMENT<BR>12 - INIT_DESCRIPTOR<BR>13 - MEMORY_POOL_PRESSURE<BR>14 - DESCRIPTOR_ALLOCATOR<BR>15 - DESCRIPTOR_ALLOCATOR_ESCAPE |
46+
|oom_resource_pools |nvarchar(max), null | Resource pools that are out of memory, including memory usage statistics for each pool. This information is provided as a JSON value. |
47+
|top_memory_clerks |nvarchar(max), not null | Top memory clerks by memory consumption, including memory usage statistics for each clerk. This information is provided as a JSON value. |
48+
|top_resource_pools |nvarchar(max), not null | Top resource pools by memory consumption, including memory usage statistics for each resource pool. This information is provided as a JSON value. |
49+
|possible_leaked_memory_clerks |nvarchar(max), null |Memory clerks that have leaked memory. Based on heuristics and provided with a finite degree of confidence. This information is provided as a JSON value. |
50+
|possible_non_sos_leaked_memory_mb |int, null |Leaked non-SOS memory in megabytes, if any. Based on heuristics and provided with a finite degree of confidence. |
51+
52+
## Permissions
53+
On [!INCLUDE[ssazuremi_md](../../includes/ssazuremi_md.md)], requires `VIEW SERVER STATE` permission.
54+
55+
On SQL Database **Basic**, **S0**, and **S1** service objectives, and for databases in **elastic pools**, the [server admin](/azure/azure-sql/database/logins-create-manage#existing-logins-and-user-accounts-after-creating-a-new-database) account, the [Azure Active Directory admin](/azure/azure-sql/database/authentication-aad-overview#administrator-structure) account, or membership in the `##MS_ServerStateReader##` [server role](/azure/azure-sql/database/security-server-roles) is required. On all other SQL Database service objectives, either the `VIEW DATABASE STATE` permission on the database, or membership in the `##MS_ServerStateReader##` server role is required.
56+
57+
## Remarks
58+
59+
Each row in this view represents an out of memory (OOM) event that has occurred in the database engine. Not all OOM events may be captured. Older OOM events may disappear from the result set as more recent OOM events occur. Result set is not persisted across restarts of the database engine.
60+
61+
## Example
62+
63+
The following example returns event data ordered by the most recent time for the currently connected database.
64+
65+
```sql
66+
SELECT * FROM sys.dm_os_out_of_memory_events ORDER BY event_time DESC;
67+
```
68+
69+
## See also
70+
71+
- [sys.resource_stats](../../relational-databases/system-catalog-views/sys-resource-stats-azure-sql-database.md)
72+
- [sys.server_resource_stats](../../relational-databases/system-catalog-views/sys-server-resource-stats-azure-sql-database.md)
73+
- [sys.dm_db_resource_stats](sys-dm-db-resource-stats-azure-sql-database.md)
74+
75+
## Next steps
76+
77+
- [Monitor In-Memory OLTP storage in Azure SQL Database and Azure SQL Managed Instance](/azure/azure-sql/in-memory-oltp-monitor-space)
78+
- [Troubleshoot out of memory errors with Azure SQL Database](/azure/azure-sql/database/troubleshoot-memory-errors-issues)

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13020,6 +13020,8 @@ items:
1302013020
href: relational-databases/system-dynamic-management-views/sys-dm-os-memory-objects-transact-sql.md
1302113021
- name: sys.dm_os_memory_pools
1302213022
href: relational-databases/system-dynamic-management-views/sys-dm-os-memory-pools-transact-sql.md
13023+
- name: sys.dm_os_out_of_memory_events
13024+
href: relational-databases/system-dynamic-management-views/sys-dm-os-out-of-memory-events.md
1302313025
- name: sys.dm_os_nodes
1302413026
href: relational-databases/system-dynamic-management-views/sys-dm-os-nodes-transact-sql.md
1302513027
- name: sys.dm_os_performance_counters

0 commit comments

Comments
 (0)