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§
- linux
Linux Linux specific implementation.
Functions§
- available
Windows or Linux or macOS or iOS Get the number of bytes of available physical memory on this host. - total
Windows or Linux or macOS or iOS Get the total number of bytes of physical memory on this host. - used
Windows or Linux or macOS or iOS Get the number of bytes of physical memory currently in use.