메모리 내 OLTP에 대한 시스템 수준 메모리 소비자를 보고합니다. 이러한 소비자에 대한 메모리는 기본 풀(할당이 사용자 스레드의 컨텍스트에 있는 경우)에서 제공되거나 내부 풀(할당이 시스템 스레드의 컨텍스트에 있는 경우)에서 제공됩니다.
-- system memory consumers @ instance
select * from sys.dm_xtp_system_memory_consumers
자세한 내용은 메모리 내 OLTP(메모리 내 최적화)를 참조하십시오.
적용 대상: SQL Server(SQL Server 2014 - 현재 버전) |
열 이름 |
형식 |
설명 |
|---|---|---|
memory_consumer_id |
bigint |
메모리 소비자의 내부 ID입니다. |
memory_consumer_type |
int |
메모리 소비자의 유형을 나타내는 정수입니다.
|
memory_consumer_type_desc |
nvarchar(16) |
메모리 소비자의 유형에 대한 설명입니다.
|
memory_consumer_desc |
nvarchar(64) |
메모리 소비자 인스턴스에 대한 설명입니다.
|
lookaside_id |
bigint |
스레드-로컬, 할당 준비 메모리 공급자의 ID입니다. |
pagepool_id |
bigint |
스레드-로컬, 페이지 풀 메모리 공급자의 ID입니다. |
allocated_bytes |
bigint |
이 소비자에 대해 예약된 바이트 수입니다. |
used_bytes |
bigint |
이 소비자가 사용하는 바이트입니다. varheap 메모리 소비자에만 적용됩니다. |
allocation_count |
int |
할당 수입니다. |
partition_count |
int |
내부적으로만 사용됩니다. |
sizeclass_count |
int |
내부적으로만 사용됩니다. |
min_sizeclass |
int |
내부적으로만 사용됩니다. |
max_sizeclass |
int |
내부적으로만 사용됩니다. |
memory_consumer_address |
varbinary |
소비자의 내부 주소입니다. |
사용 권한
서버에 대한 VIEW SERVER STATE 권한이 필요합니다.
사용자 시나리오
-- system memory consumers @ instance
selectmemory_consumer_type_desc,
allocated_bytes/1024 as allocated_bytes_kb,
used_bytes/1024 as used_bytes_kb, allocation_count
from sys.dm_xtp_system_memory_consumers
출력은 시스템 수준에서 모든 메모리 소비자를 보여 줍니다. 예를 들어 트랜잭션 할당 준비를 위한 소비자가 있습니다.
memory_consumer_type_name memory_consumer_desc allocated_bytes_kb used_bytes_kb allocation_count
------------------------------- --------------------- ------------------- -------------- ----------------
VARHEAP Lookaside heap 0 0 0
VARHEAP System heap 768 0 2
LOOKASIDE GC transaction map entry 64 64 910
LOOKASIDE Redo transaction map entry 128 128 1260
LOOKASIDE Recovery table cache entry 448 448 8192
LOOKASIDE Transaction recent rows 3264 3264 4444
LOOKASIDE Range cursor 0 0 0
LOOKASIDE Hash cursor 3200 3200 11070
LOOKASIDE Transaction save-point set entry 0 0 0
LOOKASIDE Transaction partially-inserted rows set 704 704 1287
LOOKASIDE Transaction constraint set 576 576 1940
LOOKASIDE Transaction save-point set 0 0 0
LOOKASIDE Transaction write set 704 704 672
LOOKASIDE Transaction scan set 320 320 156
LOOKASIDE Transaction read set 704 704 343
LOOKASIDE Transaction 4288 4288 1459
PGPOOL System 256K page pool 5120 5120 20
PGPOOL System 64K page pool 0 0 0
PGPOOL System 4K page pool 24 24 6
시스템 할당자가 사용하는 총 메모리를 보려면 다음을 수행합니다.
select sum(allocated_bytes)/(1024*1024) as total_allocated_MB, sum(used_bytes)/(1024*1024) as total_used_MB
from sys.dm_xtp_system_memory_consumers
total_allocated_MB total_used_MB
-------------------- --------------------
2 2