carb::extras::getPhysicalMemory

Defined in carb/extras/MemoryUsage.h

inline size_t carb::extras::getPhysicalMemory(MemoryQueryType type)

Retrieve the physical memory available on the system.

Note

On Linux, disk cache memory doesn’t count as available memory, so allocations may still succeed if available memory is near 0, but it will contribute to system slowdown if it’s using disk cache space.

Parameters

type[in] The type of memory to query.

Returns

The physical memory available on the system.

Returns

0 if the operation failed.