mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-09 05:43:44 +00:00
fix available_memory calculation
This commit is contained in:
parent
75a86e4eb1
commit
6d7801de87
1 changed files with 1 additions and 1 deletions
|
@ -404,7 +404,7 @@ static uint64_t device_host_physical_memory(bool available) {
|
||||||
|
|
||||||
if (available) {
|
if (available) {
|
||||||
if (host_statistics64(host, HOST_VM_INFO64, (host_info64_t)&vm_stats, &count) == KERN_SUCCESS) {
|
if (host_statistics64(host, HOST_VM_INFO64, (host_info64_t)&vm_stats, &count) == KERN_SUCCESS) {
|
||||||
memory = (vm_stats.internal_page_count - vm_stats.purgeable_count) * sysconf(_SC_PAGESIZE);
|
memory = total_memory - (vm_stats.internal_page_count - vm_stats.purgeable_count) * sysconf(_SC_PAGESIZE);
|
||||||
} else {
|
} else {
|
||||||
LOG_INF("host_statistics64 failed\n");
|
LOG_INF("host_statistics64 failed\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue