> ## 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.

# XMemGetWin32HeapStatistics

> XMemGetWin32HeapStatistics

# XMemGetWin32HeapStatistics

Gets the statistics for a given heap.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
BOOL XMemGetWin32HeapStatistics(
    _In_ HANDLE Heap,
    _Out_ PWIN32_HEAP_STATISTICS Statistics
    );
```

<a id="parametersSection" />

### Parameters

*Heap*   \_In\_\
Type: HANDLE

The heap handle to retrieve statistics for

*Statistics*   \_Out\_\
Type: PWIN32\_HEAP\_STATISTICS

A pointer to the [WIN32\_HEAP\_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics) structure to contain the statistics.

<a id="retvalSection" />

### Return value

Type: BOOL

Returns `TRUE` if the [WIN32\_HEAP\_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics) structure could be populated; otherwise, `FALSE`.

<a id="remarksSection" />

## Remarks

This function returns statistics, such as the commit size in a win32 heap.  The returned commit size is an estimation of the total memory consumed by a win32 heap.

<a id="requirementsSection" />

## Requirements

**Header:** xmem.h

**Library:** xmem.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[Diagnostics and memory tracking](/build/console-features/memory/system-memory-diagnostics)\
[WIN32\_HEAP\_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics)\
[XMem](/reference/system/xmem/xmem_members)


## Related topics

- [WIN32_HEAP_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics.md)
- [XMemGetWin32HeapName](/reference/system/xmem/functions/xmemgetwin32heapname.md)
- [XMemSetWin32HeapName](/reference/system/xmem/functions/xmemsetwin32heapname.md)
- [XMemCreateWin32Heap](/reference/system/xmem/functions/xmemcreatewin32heap.md)
- [XMemSetWin32HeapTrackingHooks](/reference/system/xmem/functions/xmemsetwin32heaptrackinghooks.md)
