R C-R wrote:
Michelasso wrote:
Real memory is supposed to be bigger than the active memory used by the process. It should be at least the sum of the process' wired, active, and inactive memory used. Forgetting about inactive memory, which behavior changed with every new release of Lion, the picture shows that just the active memory is higher than the sum of the real memory used by all processes.
It should not be a surprise that active memory is not the same as the sum of the real memory used by all running processes. The real memory column in Activity Monitor includes both the active & inactive memory of each process, but it does not include any wired memory that process may be using since the system allocates that & it may be shared by several different processes. Likewise, you have to consider any shared memory shown since that is by definition used by more than one process.
I don't know how to explain it any better than this. If you sum a number of things that don't include every contribution to the total & include amounts counted more than once, I don't understand why you think that should be an accurate total.
That's why when we add them up the total "real memory" should be bigger than the active memory, not smaller. That's why I insist. The point is that Activity Monitor naming doesn't make any sense. That utility should be either trashed or totally rewritten because it caused already far too much confusion. What AM calls "real memory" is instead "resident memory", as "top" rightly defines it. The values in AM and top are exactly the same. I triple checked. Calling it "real memory" make people think that it is the total amount of RAM the process is using. Well, apparently it isn't so. Otherwise I don't know how to justify this line from the top header:
MemRegions: 19363 total, 1025M resident, 44M private, 348M shared. PhysMem: 362M wired, 1442M active, 873M inactive, 2676M used, 394M free.
The 1025M is (must be actually) the total RSIZE (real mem in AM terminology) memory for all processes. Even summing up all resident values they are still slightly lower than the active memory. At this point what's the correlation between the resident memory and wired/active/inactive memory isn't given to know.
When we say "Safari web process is using 1.2GB of RAM!" we are actually saying "Safari web process resident memory is 1.2GB". Which is what top rightly says. Same number, wrong meaning in AM. So guess what. The total RAM really used by SWC or any other process is/can be even [much] higher than what we usually think. That's why the free memory can go down to 0 with AM not showing the reason. That's why this thread is 42 pages long.
My guess is that this is because we are dealing with Mach numbers for the kernel/virtual memory system, and BSD numbers for the processes. They simply don't seem to match, whatever it is the reason. What I know is that I can't trust those numbers. Not the ones for the processes at least. The whole RAM usage is much larger than the one reported for the processes. That's the only thing I know for sure and that's why many people keep complaining or wondering.