Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dasx

macrumors 65816
Original poster
Jun 18, 2012
1,107
18
Barcelona
Hey there.
I've found a discrepancy in total RAM used and I can't figure out why it is. My only guess is there are some RAM used by some stuff impossible to identify, but seems pretty unlikely to me.

From the beginning:
1. Launch Activity Monitor and sum the Active Memory + Wired Memory in the Memory tab. This'll give you some number of GB used. (User RAM + system RAM that is if I'm correct).
2. Order processes by RAM and sum their RAM usage. It's not even close. And I'm talking almost 30% off.

If someone's into terminal just open it up and run:
(did it quickly so it's probably a little bit redundant)

Code:
top -l1 -o RSIZE | sed 1,12d | awk '{print $11}' | sed -e 's/[+,-]//g' -e 's/K//g' -e 's/M/*1024/g' | bc | awk '{RAM+=$1} END {printf "\nProcesses RAM:\t%.2fGB\n",RAM/1024/1024}'; active=`vm_stat | grep ' active' | awk '{print $3}'`; wired=`vm_stat | grep wired | awk '{print $4}'`; echo    $wired $active | awk '{printf "RAM Usage:\t%.2fGB\n\n",($1+$2)*4096/1024/1024/1024}'

It'll print out the total amount of RAM used by processes and then the active + wired RAM. Here's my example:

attachment.php


As you can see there's around a 25% off in this case.

Any ideas why this happens?
 

Attachments

  • Captura de pantalla 2012-12-20 a la(s) 17.42.27.png
    Captura de pantalla 2012-12-20 a la(s) 17.42.27.png
    64.4 KB · Views: 210
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.