mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 13:45:12 +02:00
expanded comment to explain method.
This commit is contained in:
parent
dbed44198b
commit
1c3bfdb0f9
@ -37,7 +37,8 @@ pub(crate) fn get_swap_usage(sys: &System) -> Option<MemHarvest> {
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns cache usage.
|
||||
/// Returns cache usage. sysinfo has no way to do this directly but it should equal the difference
|
||||
/// between the available and free memory. On windows, this will always be 0. TODO: hide on windows?
|
||||
pub(crate) fn get_cache_usage(sys: &System) -> Option<MemHarvest> {
|
||||
let mem_used_in_kib = (sys.available_memory() - sys.free_memory()) / 1024;
|
||||
let mem_total_in_kib = sys.total_memory() / 1024;
|
||||
|
Loading…
x
Reference in New Issue
Block a user