summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJos Dehaes <jos.dehaes@gmail.com>2021-10-05 15:43:05 +0200
committerJos Dehaes <jos.dehaes@gmail.com>2021-10-05 15:43:05 +0200
commit899be68a78270216bfdcca5f0c87668a87c8792f (patch)
tree2d6ec6a03003abbaf540c5a79897a9c38b796406
parenta1c7f935e3a5661688c0de1ad3226f7bc43b9979 (diff)
correct cached size
-rw-r--r--src/osx/btop_collect.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osx/btop_collect.cpp b/src/osx/btop_collect.cpp
index dc84fe0..dce187c 100644
--- a/src/osx/btop_collect.cpp
+++ b/src/osx/btop_collect.cpp
@@ -247,12 +247,12 @@ namespace Mem {
auto &mem = current_mem;
static const bool snapped = (getenv("BTOP_SNAPPED") != NULL);
- vm_statistics p;
- mach_msg_type_number_t info_size = HOST_VM_INFO_COUNT;
- if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&p, &info_size) == 0) {
+ 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") = 100;
+ mem.stats.at("cached") = p.external_page_count * Shared::pageSize;
mem.stats.at("used") = ((int64_t)p.active_count + (int64_t)p.inactive_count + (int64_t)p.wire_count) * (int64_t)Shared::pageSize;
}