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

# XMemGetWin32HeapStatistics

> XMemGetWin32HeapStatistics

Gets the statistics for a given heap.

## Syntax

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

### 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](https://docs.xbox.com/reference/system/xmem/structs/win32_heap_statistics.md) structure to contain the statistics.

### Return value

Type: BOOL

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

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

## Requirements

**Header:** xmem.h

**Library:** xmem.lib

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

## See also

[Diagnostics and memory tracking](https://docs.xbox.com/build/console-features/memory/system-memory-diagnostics.md)\
[WIN32\_HEAP\_STATISTICS](https://docs.xbox.com/reference/system/xmem/structs/win32_heap_statistics.md)\
[XMem](https://docs.xbox.com/reference/system/xmem/xmem_members.md)


## Related topics

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