Understanding RAM and Activity Monitor
Hello,
I am hoping someone can help me make sense of the memory stats on the new activity monitor, some of the things I'm seeing don't make sense according to my (fairly rudimentary) understanding of how Mavericks manages RAM. I want to know because although my computer is running pretty satisfactorily, I'm thinking about buying RAM and just generally want to understand my system better and make sure I'm getting the most out of it.
I'm running a baseline model of the most recent Mac mini (Late 2012), which is about a year old now. It has a 2.5GHz Core i5 and 4GB memory, >100GB free hard disk space.
My problem is that I don't understand the information on Activity Monitor. As people will be aware, Apple changed the information it presents in Activity Monitor Mavericks. In typical daily use, things start to get a bit creaky with a Safari, Word, Mail, and my bigish iTunes (~60GB) and iPhoto (~15GB) libraries open, and Activity Monitor will tell me something like this:
Physical memory: 4.00 GB Memory Used: 3.93 GB Virtual Memory: 5.10 GB Swap Used: 0 bytes
This seems to mostly make sense in itself (I know Mavericks can compress RAM so it designed to maximise RAM utilisation and then just compress when space needs to be freed up for a new process), though I don't understand why virtual memory would be anything other than 0 bytes if Swap Used is also 0 bytes - is this just the amount of disk space set aside by the OS should it be required?
What I find really confusing is that if I run vm_stat in terminal I get numbers like this:
Pageins: 285651. Pageouts: 35809.
How can I have pageouts above 0 if Swap Used is 0 bytes? Moreover, Pageouts/Pageins > 0.1, which lots of people quote as a good rule of thumb for judging whether your RAM is overstretched. So what's going on? How can the system be writing pageouts without using any "swap". My "Memory Pressue" meter is nice and green and low but I'm not sure I trust this as it's unclear how much of an abstraction it is.
When I really push my computer (10 apps +), then it does start to use swap, but only really small amounts, even when the computer is really straining (SBBOD and app crashes left, right and centre). Even when it does use swap, the memory pressure stays green, but I read that it was meant to turn yellow when using Swap (another reason why I don't trust that it is telling me anything meaningful). These are the readouts in the high intensity situation (Activity Monitor and vm_stat respectively):
Physical memory: 4.00 GB Memory Used: 3.99 GB Virtual Memory: 7.59 GB Swap Used: 13.5 MB
Pageins: 1386280. Pageouts: 435686. [Pageouts/Pageins = 0.314]
Any help or explanation/perspectives would be greatly appreciated. I suppose my main question is whether the lagginess and unresponsiveness of my computer during moderate/heavy use is a result of limited memory, or whether it's simply that there are likely lots of CPU tasks running at the same time (or something else?).
Many thanks is advance.
Mac mini, OS X Mavericks (10.9.1)