Commit 65802a20 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'macos-available_memory'

d1536b02 macOS: Better approximation for AvailablePhysicalMemory
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !128
parents ce89cada d1536b02
......@@ -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<size_t>(available_memory / 1048576);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment