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

# XMemGetAllocationStatistics

> XMemGetAllocationStatistics recupera as contagens de alocação e os totais de bytes de um heap de título do XBOX GDK especificado por meio da estrutura XMEM_HEAP_STATISTICS.

# XMemGetAllocationStatistics

Obtém as estatísticas de um determinado heap.

<a id="syntaxSection" />

## Sintaxe

```cpp theme={null}
BOOL XMemGetAllocationStatistics(  
         DWORD MemType,  
         BOOL LargeHeap,  
         PXMEM_HEAP_STATISTICS Statistics  
)  
```

<a id="parametersSection" />

### Parâmetros

*MemType*   \_In\_<br />Tipo: DWORD

A constante `XALLOC_MEMTYPE_GRAPHICS_*` que descreve o heap. Para obter mais informações, confira a seção [MemoryType](/pt-BR/reference/system/xmem/structs/xalloc_attributes#memorytypeSection) em [XALLOC\_ATTRIBUTES](/pt-BR/reference/system/xmem/structs/xalloc_attributes).

*LargeHeap*   \_In\_<br />Tipo: BOOL

`TRUE` se o heap for "grande"; caso contrário, `FALSE`. Um heap "grande" é usado para atender a alocações de 4 KB a 128 KB ou cujo alinhamento é especificado como 4 KB ou mais. Em comparação, um heap "pequeno" é usado para atender a alocações menores que 4 KB e cujo alinhamento é especificado como menor que 4 KB.

*Statistics*   \_Inout\_<br />Tipo: PXMEM\_HEAP\_STATISTICS

Um ponteiro para a estrutura [XMEM\_HEAP\_STATISTICS](/pt-BR/reference/system/xmem/structs/xmem_heap_statistics) que conterá as estatísticas.

<a id="retvalSection" />

### Valor retornado

Tipo: BOOL

Retorna `TRUE` se a estrutura [XMEM\_HEAP\_STATISTICS](/pt-BR/reference/system/xmem/structs/xmem_heap_statistics) puder ser preenchida; caso contrário, `FALSE`.

<a id="remarksSection" />

## Comentários

Essa função retorna estatísticas, como o tamanho máximo alocado e a contagem de alocações, em uma estrutura `XMEM_HEAP_STATISTICS` para o heap descrito em `MemType`. Para obter mais informações sobre a memória gráfica, confira [Visão geral da memória gráfica para o GDK](/pt-BR/build/core-features/graphics/graphics-memory-overview).

O exemplo a seguir ilustra como usar essa função para obter estatísticas da memória "garlic" (com combinação de gravação na CPU e não coerente na GPU).

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

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** xmem.h

**Biblioteca:** xmem.lib

**Plataformas com suporte:** consoles da família XBOX One e consoles XBOX Series

<a id="seealsoSection" />

## Confira também

[Diagnóstico e rastreamento de memória](/pt-BR/build/console-features/memory/system-memory-diagnostics)<br />[XALLOC\_ATTRIBUTES](/pt-BR/reference/system/xmem/structs/xalloc_attributes)<br />[XMEM\_HEAP\_STATISTICS](/pt-BR/reference/system/xmem/structs/xmem_heap_statistics)<br />[XMem](/pt-BR/reference/system/xmem/xmem_members)


## Related topics

- [NDA topic directory - live Microsoft Learn links](/nda/nda-topic-directory.md)
- [XMemGetWin32HeapStatistics](/reference/system/xmem/functions/xmemgetwin32heapstatistics.md)
- [XMemGetWorkingSetStatistics](/reference/system/xmem/functions/xmemgetworkingsetstatistics.md)
- [WIN32_HEAP_STATISTICS](/reference/system/xmem/structs/win32_heap_statistics.md)
- [PFMemGetFunctions](/services/playfab/api-references/c/pfplatform/functions/pfmemgetfunctions.md)
