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

# XMemGetWorkingSetStatistics

> XMemGetWorkingSetStatistics

Provides details of the exact usage of the memory in a title process.

## Syntax

```cpp theme={null}
WINAPI
XMemGetWorkingSetStatistics(
  _In_ DWORD WorkingSetFlags,
  _Out_ PXMEM_WORKING_SET_STATISTICS Statistics
  );
```

### Parameters

*WorkingSetFlags*   \_In\_\
Type: DWORD

A bitwise-OR combination of flags that represent the partitions included in the usage statistics.

| Flag | Description |
| - | - |
| XMEM\_WORKING\_SET\_TITLE | Title partition |
| XMEM\_WORKING\_SET\_TOOLS | Tools partition |
| XMEM\_WORKING\_SET\_STACK | Thread stack |
| XMEM\_WORKING\_SET\_KERNEL\_POOL | Kernel pool |
| XMEM\_WORKING\_SET\_CPU\_PTE | CPU page table size |
| XMEM\_WORKING\_SET\_ALL | All This flag represents a bitwise-OR combination of XMEM\_WORKING\_SET\_TITLE, XMEM\_WORKING\_SET\_TOOLS, XMEM\_WORKING\_SET\_STACK,  XMEM\_WORKING\_SET\_KERNEL\_POOL, and XMEM\_WORKING\_SET\_CPU\_PTE |

*Statistics*   \_Out\_\
Type: PXMEM\_WORKING\_SET\_STATISTICS

The address of an [XMEM\_WORKING\_SET\_STATISTICS](https://docs.xbox.com/reference/system/xmem/structs/xmem_working_set_statistics.md) structure to receive memory usage information.

### Return value

Type: BOOL

Returns `TRUE` if successful; otherwise, returns `FALSE`. To get extended error information, call [GetLastError](https://msdn.microsoft.com/library/windows/desktop/ms679360\(v=vs.85\).aspx).

## Remarks

This function retrieves statistics about memory utilization, depending on the flags specified in `WorkingSetFlags`, as an `XMEM_WORKING_SET_STATISTICS` structure. The structure provides information about the total size & usage of memory configured for the title process. For more information about configuring memory for your title, see [Configuring memory for your title and dev kit](https://docs.xbox.com/build/console-features/memory/system-memory-tooling.md).

> [!NOTE]
>
> XMemGetWorkingSetStatistics is intended as a diagnostics function and, in general, provides no performance guarentees about the running time required to retrieve the requested data.  The only exception to this policy is for XMEM\_WORKING\_SET\_TITLE which is specifically designed to be usable in performance sensitive scenarios.

## Requirements

**Header:** xmem.h

**Library:** xmem.lib

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

## See also

[Memory](https://docs.xbox.com/build/console-features/memory/system-memory-overview.md)\
[XMEM\_WORKING\_SET\_STATISTICS](https://docs.xbox.com/reference/system/xmem/structs/xmem_working_set_statistics.md)\
[XMem](https://docs.xbox.com/reference/system/xmem/xmem_members.md)


## Related topics

- [Working with the Microsoft GDK Game OS memory manager](https://docs.xbox.com/build/console-features/memory/system-memory-working.md)
- [PFStatisticsGetStatisticsRequest](https://docs.xbox.com/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticsgetstatisticsrequest.md)
- [PFStatisticsGetStatisticsForEntitiesRequest](https://docs.xbox.com/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticsgetstatisticsforentitiesrequest.md)
- [Create a basic statistic](https://docs.xbox.com/services/playfab/player-progression/statistics/create-basic-statistics.md)
- [NDA topic directory - live Microsoft Learn links](https://docs.xbox.com/nda/nda-topic-directory.md)
