pub struct MemoryStatus {
pub total_bytes: u64,
pub available_bytes: u64,
pub free_bytes: u64,
pub cached_bytes: u64,
pub swap_total_bytes: u64,
pub swap_used_bytes: u64,
}Expand description
The guest’s own account of machine memory, from /proc/meminfo.
This is what a machine is actually using. The host-side phys_footprint
answers a different question — it counts compressed pages at their
uncompressed size and keeps counting memory the guest has stopped needing —
so it runs well above these figures and should not be read as consumption.
Fields§
§total_bytes: u64Total usable RAM the guest sees, in bytes. Slightly below the machine’s configured size: the kernel reserves some before the allocator sees it.
available_bytes: u64Memory available for new allocations without swapping, in bytes. The
figure to report, since free_bytes excludes reclaimable page cache.
free_bytes: u64Free memory in bytes: never allocated, or released and not reused.
cached_bytes: u64Page cache in bytes. Counted inside available_bytes.
swap_total_bytes: u64Swap configured in the guest, in bytes. Zero when the guest has none.
swap_used_bytes: u64Swap in use, in bytes.
Implementations§
Source§impl MemoryStatus
impl MemoryStatus
Sourcepub fn used_bytes(&self) -> u64
pub fn used_bytes(&self) -> u64
Memory the guest cannot hand back on demand.