> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XMEM_HEAP_STATISTICS

> XMEM_HEAP_STATISTICS

# XMEM\_HEAP\_STATISTICS

包含指定堆積的統計資料。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
typedef struct XMEM_HEAP_STATISTICS {  
    ULONG dwSize;  
    ULONG dwPageGroupSize;
    SIZE_T dwMaximumAllocatedSize;  
    SIZE_T dwMinimumFreeDepth;  
    ULONG dwAllocationCount;  
    ULONG dwFreeCount;  
} XMEM_HEAP_STATISTICS  
```

<a id="membersSection" />

### 成員

*dwSize*<br />類型：ULONG

`XMEM_HEAP_STATISTICS` 結構的大小。將結構傳遞給 [XMemGetAllocationStatistics](/zh-TW/reference/system/xmem/functions/xmemgetallocationstatistics) 之前，必須先設定此成員。

*dwPageGroupSize*<br />類型：ULONG

待定

*dwMaximumAllocatedSize*<br />類型：SIZE\_T

堆積曾經成長到的最大大小 (以位元組為單位)。

*dwMinimumFreeDepth*<br />類型：SIZE\_T

從未使用的可用記憶體數量 (以位元組為單位)。每次呼叫變更遲滯量或預先配置分頁之後，此值都會重設。如果此數字不是零，表示遲滯設定得太高，因為有已配置但從未使用的分頁。

*dwAllocationCount*<br />類型：ULONG

此堆積呼叫核心要求記憶體的次數。

*dwFreeCount*<br />類型：ULONG

此堆積呼叫核心歸還記憶體的次數。

<a id="remarksSection" />

## 備註

[XMemGetAllocationStatistics](/zh-TW/reference/system/xmem/functions/xmemgetallocationstatistics) 會使用此結構來提供指定堆積的相關統計資料。如需圖形記憶體的詳細資訊，請參閱 [GDK 的圖形記憶體概觀](/zh-TW/build/core-features/graphics/graphics-memory-overview)。

下列範例說明如何使用 `XMemGetAllocationStatistics` 函式，以「garlic」(CPU 寫入合併且 GPU 不一致) 記憶體的統計資料填入此結構。

```cpp theme={null}
XMEM_HEAP_STATISTICS statistics;
statistics.dwSize = sizeof( statistics );
BOOL success = XMemGetAllocationStatistics(XALLOC_MEMTYPE_GRAPHICS_WRITECOMBINE, TRUE, &statistics);
```

<a id="requirementsSection" />

## 需求

**標頭：** xmem.h

**支援的平台：** XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[診斷與記憶體追蹤](/zh-TW/build/console-features/memory/system-memory-diagnostics)<br />[XALLOC\_ATTRIBUTES](/zh-TW/reference/system/xmem/structs/xalloc_attributes)<br />[XMem](/zh-TW/reference/system/xmem/xmem_members)


## Related topics

- [XMemGetWin32HeapStatistics](/reference/system/xmem/functions/xmemgetwin32heapstatistics.md)
- [WIN32_HEAP_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics.md)
