Skip to main content

total_memory_used_bytes

Function total_memory_used_bytes 

Source
pub fn total_memory_used_bytes() -> usize
Expand description

Returns the total memory used in bytes.

In a container, this returns the cgroup’s memory usage, including memory charged for file cache. If the cgroup usage is unavailable or invalid, this returns the host’s used memory instead. The cgroup mount point is assumed to be at /sys/fs/cgroup.

§Examples

Basic usage:

ⓘ
let mem_used = memory::total_memory_used_bytes();