Sorry, I don't understand how to break the quoted test to write in the middle of it. So I'll just reply to this one.
R C-R wrote:
If the free memory is below the low water mark, OS X should free a bunch of pages from the inactive memory. I have been monitoring the memory usage in the last few days and as far as I could check none of that happened.
It frees up only as many pages of inactive memory as it needs. And it does this much faster & more often than you can track during normal operation.
I've read this argument before. True, in 1 second time frame who knows what really happens. But here we are talking about activities visible to the human eye (by mean of a monitoring tool, obviously) that do not really fit with what one think should be the most efficient behavior.
Like now for example. I just streamed a movie to my PS3 and the what I call "available memory" (about 1GB) still kept constant. Only that the Inactive memory raised to 980MB and the Free memory went down to 20MB. The swap area was reported to be 0B. So I decided to open Chrome on top of that and load all preferred tabs. It freed some memory (100MB or so) and filled a swap area of 320MB (page out).
Closed Chrome, the swap area went down to 37MB and the Free Memory up to 753MB!! Plus 179MB of Inactive memory. What.. the .. beep?!
That means that Lion paged out 320MB, allegedly from Inactive memory, gave it to Chrome, and once Chrome was closed it decided that not only the paged Inactive memory was not needed, but also another 1/2 GB on top of that could be freely given back to the kernel. Couldn't it just free it as soon as it was needed? Did it have to add hard disk writes overhead? I repeat, to me this is either a bug or a very dumb decision. A new active process should have priority over some forgotten data that might be useful in the future.
BTW to disable the virtual memory I use this command:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
After that the dynamic_pager process disappears:
BlueMoon:Scripts $ ps -ef | grep dyn
0 73 1 0 2:57pm ?? 0:00.17 /sbin/dynamic_pager -F /private/var/vm/swapfile
502 809 235 0 8:24pm ttys000 0:00.01 grep dyn
BlueMoon:Scripts $ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
Password:
BlueMoon:Scripts $ ps -ef | grep dyn
502 815 235 0 8:24pm ttys000 0:00.00 grep dyn
BlueMoon:Scripts $
I think at this point there is no more virtual memory. Not sure how it works.