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

# XMemGetWorkingSetStatistics

> XMemGetWorkingSetStatistics

# XMemGetWorkingSetStatistics

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

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### 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<br />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](/reference/system/xmem/structs/xmem_working_set_statistics) structure to receive memory usage information.

<a id="retvalSection" />

### Return value

Type: BOOL

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

<a id="remarksSection" />

## 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](/build/console-features/memory/system-memory-tooling).

<br />

<br />

<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.</Note>

<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

[Memory](/build/console-features/memory/system-memory-overview)\
[XMEM\_WORKING\_SET\_STATISTICS](/reference/system/xmem/structs/xmem_working_set_statistics)\
[XMem](/reference/system/xmem/xmem_members)


## Related topics

- [Working with the Microsoft GDK Game OS memory manager](/build/console-features/memory/system-memory-working.md)
- [PFStatisticsGetStatisticsRequest](/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticsgetstatisticsrequest.md)
- [PFStatisticsGetStatisticsForEntitiesRequest](/services/playfab/api-references/c/pfstatisticstypes/structs/pfstatisticsgetstatisticsforentitiesrequest.md)
- [XMemMakeTag](/reference/system/xmem/functions/xmemmaketag.md)
- [XMemFreePhysicalPages](/reference/system/xmem/functions/xmemfreephysicalpages.md)
