I dont know how to get the advertised 3kb ram usage and also dont see how this is possible considering you are using tokio.
I tested this using the sysinfo (0.30.8) crate and added these lines to src/service/server in fn service.
tokio::spawn(async {
let mut system = sysinfo::System::new_all();
let pid = sysinfo::get_current_pid().unwrap();
loop {
system.refresh_all();
if let Some(process) = system.process(pid) {
println!(
"phisical {} kb, {} mb ; virtual {} kb, {} mb",
process.memory() / 1000,
process.memory() / 1000_000,
process.virtual_memory() / 1000,
process.virtual_memory() / 1000_000
);
} else {
println!("Failed to get process information.");
}
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
}
});
When compiled on Windows 10 in release i get ~20500kb physical and ~14000kb virtual Memory
When compiled on Arch Linux i get:
using glibc ~5000kb physical and ~188500kb virtual Memory
using musl ~3000kb physical and ~70500kb virtual Memory
(compiled using cargo b --release)
Now dont get me wrong 3mb is extremly little ram, but still it isnt 3kb.
Am i doing something wrong or may there be a Typo in the README?
I dont know how to get the advertised 3kb ram usage and also dont see how this is possible considering you are using tokio. I tested this using the sysinfo (0.30.8) crate and added these lines to src/service/server in fn service.
(compiled using
cargo b --release
)Now dont get me wrong 3mb is extremly little ram, but still it isnt 3kb. Am i doing something wrong or may there be a Typo in the README?