Vm_stat displays less memory than real

Update:

So, rebooting the mac did the job, but any known reason for this error?


I use vm_stat to calculate RAM information such as here

But when I try to add all the values ​​and multiply them by the page size im, getting approx. 1.3 GB less.

 Mach Virtual Memory Statistics: (page size of 4096 bytes) Pages free: 22064. Pages active: 580105. Pages inactive: 472217. Pages speculative: 5594. Pages throttled: 0. Pages wired down: 559999. Pages purgeable: 29101. "Translation faults": 261945239. Pages copy-on-write: 6941679. Pages zero filled: 165324784. Pages reactivated: 14573079. Pages purged: 1602247. File-backed pages: 203023. Anonymous pages: 854893. Pages stored in compressor: 1732046. Pages occupied by compressor: 456427. Decompressions: 11423912. Compressions: 20641865. Pageins: 4475678. Pageouts: 32877. Swapins: 1714616. Swapouts: 2389086. 

So, adding the first 6 values ​​and multiplying them with the page size, im getting 6.7GB , but my mac has 8GB .

So what is going wrong?

Thanks!


Here is the result

enter image description here


After reboot

enter image description here

+2
source share
1 answer

It seems to me that you need to add "Pages occupied by compressor". This will deliver you almost exactly 8 GB. A reboot is probably just a reset, which is zero, so that doesn't matter.

+1
source

Source: https://habr.com/ru/post/1389966/


All Articles