Vulkan Memory Allocator
Classes | Typedefs | Functions
Statistics

API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. More...

Classes

struct  VmaStatInfo
 Calculated statistics of memory usage in entire allocator. More...
 
struct  VmaStats
 General statistics from current state of Allocator. More...
 
struct  VmaBudget
 Statistics of current memory usage and available budget, in bytes, for specific memory heap. More...
 
struct  VmaPoolStats
 Describes parameter of existing VmaPool. More...
 

Typedefs

typedef struct VmaStatInfo VmaStatInfo
 Calculated statistics of memory usage in entire allocator. More...
 
typedef struct VmaStats VmaStats
 General statistics from current state of Allocator. More...
 
typedef struct VmaBudget VmaBudget
 Statistics of current memory usage and available budget, in bytes, for specific memory heap. More...
 
typedef struct VmaPoolStats VmaPoolStats
 Describes parameter of existing VmaPool. More...
 

Functions

void vmaCalculateStats (VmaAllocator allocator, VmaStats *pStats)
 Retrieves statistics from current state of the Allocator. More...
 
void vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets)
 Retrieves information about current memory budget for all memory heaps. More...
 
void vmaGetPoolStats (VmaAllocator allocator, VmaPool pool, VmaPoolStats *pPoolStats)
 Retrieves statistics of existing VmaPool object. More...
 
void vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap)
 Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock. More...
 
void vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString)
 Frees a string returned by vmaBuildVirtualBlockStatsString(). More...
 
void vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap)
 Builds and returns statistics as a null-terminated string in JSON format. More...
 
void vmaFreeStatsString (VmaAllocator allocator, char *pStatsString)
 

Detailed Description

API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format.

Typedef Documentation

◆ VmaBudget

typedef struct VmaBudget VmaBudget

Statistics of current memory usage and available budget, in bytes, for specific memory heap.

◆ VmaPoolStats

typedef struct VmaPoolStats VmaPoolStats

Describes parameter of existing VmaPool.

◆ VmaStatInfo

typedef struct VmaStatInfo VmaStatInfo

Calculated statistics of memory usage in entire allocator.

◆ VmaStats

typedef struct VmaStats VmaStats

General statistics from current state of Allocator.

Function Documentation

◆ vmaBuildStatsString()

void vmaBuildStatsString ( VmaAllocator  allocator,
char **  ppStatsString,
VkBool32  detailedMap 
)

Builds and returns statistics as a null-terminated string in JSON format.

Parameters
allocator
[out]ppStatsStringMust be freed using vmaFreeStatsString() function.
detailedMap

◆ vmaBuildVirtualBlockStatsString()

void vmaBuildVirtualBlockStatsString ( VmaVirtualBlock  virtualBlock,
char **  ppStatsString,
VkBool32  detailedMap 
)

Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock.

Parameters
virtualBlockVirtual block.
[out]ppStatsStringReturned string.
detailedMapPass VK_FALSE to only obtain statistics as returned by vmaCalculateVirtualBlockStats(). Pass VK_TRUE to also obtain full list of allocations and free spaces.

Returned string must be freed using vmaFreeVirtualBlockStatsString().

◆ vmaCalculateStats()

void vmaCalculateStats ( VmaAllocator  allocator,
VmaStats pStats 
)

Retrieves statistics from current state of the Allocator.

This function is called "calculate" not "get" because it has to traverse all internal data structures, so it may be quite slow. For faster but more brief statistics suitable to be called every frame or every allocation, use vmaGetHeapBudgets().

Note that when using allocator from multiple threads, returned information may immediately become outdated.

◆ vmaFreeStatsString()

void vmaFreeStatsString ( VmaAllocator  allocator,
char *  pStatsString 
)

◆ vmaFreeVirtualBlockStatsString()

void vmaFreeVirtualBlockStatsString ( VmaVirtualBlock  virtualBlock,
char *  pStatsString 
)

Frees a string returned by vmaBuildVirtualBlockStatsString().

◆ vmaGetHeapBudgets()

void vmaGetHeapBudgets ( VmaAllocator  allocator,
VmaBudget pBudgets 
)

Retrieves information about current memory budget for all memory heaps.

Parameters
allocator
[out]pBudgetsMust point to array with number of elements at least equal to number of memory heaps in physical device used.

This function is called "get" not "calculate" because it is very fast, suitable to be called every frame or every allocation. For more detailed statistics use vmaCalculateStats().

Note that when using allocator from multiple threads, returned information may immediately become outdated.

◆ vmaGetPoolStats()

void vmaGetPoolStats ( VmaAllocator  allocator,
VmaPool  pool,
VmaPoolStats pPoolStats 
)

Retrieves statistics of existing VmaPool object.

Parameters
allocatorAllocator object.
poolPool object.
[out]pPoolStatsStatistics of specified pool.