provide memory statistics for the domain.

libvirt_domain_memory_peek
libvirt_domain_migrate_to_uri
Libvirt Functions
PHP Manual

# libvirt_domain_memory_stats

(php-libvirt 0.3)

libvirt_domain_memory_stats — provide memory statistics for the domain.

### Description

array libvirt_domain_memory_stats ( resource `$domain` [, integer `$flags`= 0 ] )

This function provides memory statistics for the domain. Up to `VIR_DOMAIN_MEMORY_STAT_NR` elements will be populated in the returned array with memory statistics from the domain. Only statistics supported by the domain, the driver, and this version of libvirt will be returned. The array is indexed by the numerical values of appropriate constants.

Possible members of the array returned by libvirt_domain_memory_stats
`VIR_DOMAIN_MEMORY_STAT_SWAP_IN` | The total amount of data read from swap space (in kb)
`VIR_DOMAIN_MEMORY_STAT_SWAP_OUT` | The total amount of memory written out to swap space (in kb)
`VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT` | The number of page faults that required disk IO to service.
`VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT` | The number of page faults serviced without disk IO.
`VIR_DOMAIN_MEMORY_STAT_UNUSED` | The amount of memory which is not being used for any purpose (in kb).
`VIR_DOMAIN_MEMORY_STAT_AVAILABLE` | The total amount of memory available to the domain's OS (in kb).
`VIR_DOMAIN_MEMORY_STAT_NR` | .

> Note: Warning
> . This function returns values that may be bigger than 32bit integer limit. Please read this note for more details.

> Note: Libvirt version
> This function has been added to Libvirt in version 0.7.5. You need this or newer version of Libvirt to be able to use this function.

### Parameters

`domain`

  Domain resource of domain to get memory stats.

`flags`

  unused, always pass 0 (or ommit the parameter as 0 is default value

### Return Values

Array containig Up to `VIR_DOMAIN_MEMORY_STAT_NR` elements with statistics.

### See Also

- libvirt_domain_block_stats() - provide block device statistics for the block device on domain.
- libvirt_domain_interface_stats() - provide interface statistics for the virtual network interface on domain.

libvirt_domain_memory_peek
libvirt_domain_migrate_to_uri
Libvirt Functions
PHP Manual