1 unstable release
0.1.0 | Feb 20, 2023 |
---|
#7 in #total
8KB
156 lines
ramusage
This crate allows you to easily query the used and total amount of memory on your system.
Usage as a library
cargo add ramusage
use memusage::Info;
let info = Info::read().expect("Failed to read memory usage");
println!("{info}");
Usage as an executable
cargo install ramusage
ramusage
OS Support
- Linux
- OpenBSD (planned)
TODO
- OpenBSD support
- Command-line arguments parser (clap)
lib.rs
:
This crate allows you to query the used and total amount of memory of your system.
OS Support
- Linux
- OpenBSD (planned)
Example
use ramusage::Info;
fn main() {
let info = Info::read().expect("Failed to read memory info.");
println!("{info}"); // 4.00 GiB/16.0 GiB
println!("{info:#}"); // 4.00G/16.0G
}