Skip to content

Commit 5508967

Browse files
authored
Merge pull request #20577 from MicrosoftDocs/FromPublicRepo
Confirm merge from FromPublicRepo to master to sync with https://github.com/MicrosoftDocs/sql-docs (branch live)
2 parents 750e5c9 + f36d4e0 commit 5508967

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

docs/relational-databases/system-dynamic-management-views/sys-dm-xtp-system-memory-consumers-transact-sql.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ ms.author: wiassaf
2525

2626
Reports system level memory consumers for [!INCLUDE[hek_2](../../includes/hek-2-md.md)]. The memory for these consumers comes either from the default pool (when the allocation is in the context of a user thread) or from internal pool (if the allocation is in the context of a system thread).
2727

28-
```
28+
```sql
2929
-- system memory consumers @ instance
30-
select * from sys.dm_xtp_system_memory_consumers
30+
SELECT *
31+
FROM sys.dm_xtp_system_memory_consumers
3132
```
3233

3334
For more information, see [In-Memory OLTP (In-Memory Optimization)](../in-memory-oltp/overview-and-usage-scenarios.md).
@@ -54,19 +55,18 @@ select * from sys.dm_xtp_system_memory_consumers
5455

5556
## User Scenario
5657

57-
```
58+
```sql
5859
-- system memory consumers @ instance
59-
selectmemory_consumer_type_desc,
60-
allocated_bytes/1024 as allocated_bytes_kb,
61-
used_bytes/1024 as used_bytes_kb, allocation_count
62-
from sys.dm_xtp_system_memory_consumers
60+
SELECT memory_consumer_type_desc, allocated_bytes/1024 as allocated_bytes_kb,
61+
used_bytes/1024 as used_bytes_kb, allocation_count
62+
FROM sys.dm_xtp_system_memory_consumers
6363
```
6464

6565
The output shows all memory consumers at system level. For example, there are consumers for transaction look aside.
6666

6767
```
68-
memory_consumer_type_name memory_consumer_desc allocated_bytes_kb used_bytes_kb allocation_count
69-
------------------------------- --------------------- ------------------- -------------- ----------------
68+
memory_consumer_type_name memory_consumer_desc allocated_bytes_kb used_bytes_kb allocation_count
69+
------------------------------- --------------------- ------------------- -------------- ----------------
7070
VARHEAP Lookaside heap 0 0 0
7171
VARHEAP System heap 768 0 2
7272
LOOKASIDE GC transaction map entry 64 64 910
@@ -90,10 +90,13 @@ PGPOOL System 4K page pool
9090

9191
To see the total memory consumed by system allocators:
9292

93-
```
94-
select sum(allocated_bytes)/(1024*1024) as total_allocated_MB, sum(used_bytes)/(1024*1024) as total_used_MB
95-
from sys.dm_xtp_system_memory_consumers
96-
93+
```sql
94+
SELECT SUM(allocated_bytes)/(1024*1024) AS total_allocated_MB, SUM(used_bytes)/(1024*1024) AS total_used_MB
95+
FROM sys.dm_xtp_system_memory_consumers
96+
```
97+
Here is the result set.
98+
99+
```
97100
total_allocated_MB total_used_MB
98101
-------------------- --------------------
99102
2 2

0 commit comments

Comments
 (0)