summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJos Dehaes <jos.dehaes@gmail.com>2021-10-18 08:10:37 +0200
committerJos Dehaes <jos.dehaes@gmail.com>2021-10-18 08:10:37 +0200
commit46030de77cb1409eb8b0247c331408a240b0227a (patch)
tree915134b9127b9babb5a8bde0abf9ba8599b696bd
parent4c228de0ef8a75275178bad081e568f85fc579fd (diff)
available = total - used
-rw-r--r--src/osx/btop_collect.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osx/btop_collect.cpp b/src/osx/btop_collect.cpp
index 0882afe..3ee4d62 100644
--- a/src/osx/btop_collect.cpp
+++ b/src/osx/btop_collect.cpp
@@ -657,10 +657,10 @@ namespace Mem {
vm_statistics64 p;
mach_msg_type_number_t info_size = HOST_VM_INFO64_COUNT;
if (host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info64_t)&p, &info_size) == 0) {
- mem.stats.at("available") = p.free_count * Shared::pageSize;
mem.stats.at("free") = p.free_count * Shared::pageSize;
mem.stats.at("cached") = p.external_page_count * Shared::pageSize;
mem.stats.at("used") = (p.active_count + p.inactive_count + p.wire_count) * Shared::pageSize;
+ mem.stats.at("available") = Shared::totalMem - mem.stats.at("used");
}
int mib[2] = {CTL_VM, VM_SWAPUSAGE};