From 8372c054729984a76e3e619b4c28865006d905d0 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Tue, 5 Feb 2019 07:19:44 -0500 Subject: KWSys 2019-02-05 (65802a20) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 65802a20ec4b9a774518151c3f8772e082163601 (master). Upstream Shortlog ----------------- Nicolae Vartolomei (1): d1536b02 macOS: Better approximation for AvailablePhysicalMemory --- SystemInformation.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 6c12355..f323efc 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -4424,7 +4424,8 @@ bool SystemInformationImplementation::ParseSysCtl() &count) == KERN_SUCCESS) { len = sizeof(value); err = sysctlbyname("hw.pagesize", &value, &len, KWSYS_NULLPTR, 0); - int64_t available_memory = vmstat.free_count * value; + int64_t available_memory = + (vmstat.free_count + vmstat.inactive_count) * value; this->AvailablePhysicalMemory = static_cast(available_memory / 1048576); } -- cgit v0.12