Skip to main content

Crate system_memory

Crate system_memory 

Source
Expand description

A small crate that resolves the total system memory of the host. This is useful for many projects that may behave differently depending on how much memory the host system has and how much is available.

Be aware of the potential for data races when using this code – since the amount of available system memory may ( and likely will) change between calls, repeated use of the function even on the same thread cannot be expected to return the same values, nor will available necessarily return values consistent with used, since the value may change between calls.

Modules§

linuxLinux
Linux specific implementation.

Structs§

Snapshot
Snapshot of the host’s memory stats.

Functions§

availableiOS or Linux or macOS or Windows
Get the number of bytes of available physical memory on this host.
totaliOS or Linux or macOS or Windows
Get the total number of bytes of physical memory on this host.
usediOS or Linux or macOS or Windows
Get the number of bytes of physical memory currently in use.