1596 Views 7 Replies Latest reply: Feb 23, 2011 7:20 PM by Kappy
About OS X Memory Management and Usage
Reading system memory usage in Activity Monitor
Memory Management in Mac OS X
Performance Guidelines- Memory Management in Mac OS X
A detailed look at memory usage in OS X
Understanding top output in the Terminal
The amount of available RAM for applications is the sum of Free RAM and Inactive RAM. This will change as applications are opened and closed or change from active to inactive status. The Swap figure represents an estimate of the total amount of swap space required for VM if used, but does not necessarily indicate the actual size of the existing swap file. If you are really in need of more RAM that would be indicated by how frequently the system uses VM. If you open the Terminal and run the top command at the prompt you will find information reported on Pageins () and Pageouts (). Pageouts () is the important figure. If the value in the parentheses is 0 (zero) then OS X is not making instantaneous use of VM which means you have adequate physical RAM for the system with the applications you have loaded. If the figure in parentheses is running positive and your hard drive is constantly being used (thrashing) then you need more physical RAM.Mac Pro 2.66 Ghz; MBP Unibody; MBP C2D 2.33 Ghz; 11" MBA, Mac OS X (10.6.5), iMac C2D 17"; MB 2.0 Ghz; iPad 32G; 80GB iPod Video; iPod Touch; iPod Nano 2GB
I am not sure you understand my problem. I know what free/wired/active/inactive memory is.
Let me put it in another way What is the *Real Mem* column in Activity Monitor? Is it the total memory used by that application (activeinactivewired) ? If yes, then the sum of Real Mem for all applications should be equal to wiredactiveinactive memory indicated.
However, it is not.
Assume my only processes are Safari and Finder. If Activity Monitor reports Safari using (real mem) 1GB and Finder using 200MB, why does it report that I have total used memory of 1.5GB ? Who takes up the extra 300MB? If *Real Mem* is not an indicator of how much total physical memory the process takes up, how do I get this number? -- before anyone responds about MacOS system processes, my example above was hypotetical, I am showing +All Processes+ in Activity Monitor and I sum-up all of their *Real Mem*.
PS - In my case, I have the dynamic_pager disabled, so I have no swap. The funny part is, Activity Monitor reports that I have 12MB of page outs. Since the swap used reported is 0, and there are no swap files and the dynamic_pager is disabled, where are those 12MB sent to?
Later edit: I am using the purge command from developer tools to empty the buffers and have no inactive memory. So the 1.5GB in the example above is wired+active memory.Macbook Pro, Mac OS X (10.4.8), C2D
I have disabled the VM
Why would you do that? My Mac has 4 GB of RAM, and even when I seriously overload it, it's still quite snappy. (We're talking about running the following apps, which I actually do from time to time: Mail, Safari, Firefox, Photoshop Elements, Intaglio, Aperture, Textwrangler, Transmit, MAMP, iTunes and a handful of small background apps like GeekTool and Quicksilver.)
Basically, you have made an unsupported modification by removing something integral to your Mac. There's a reason there's no way to turn it off except via hacks. If you were having performance issues, you need to address that in a different way... this ain't it! Turn VM back on, then check out the [Mac OS X speed FAQ|http://www.index-site.com/Macosxspeed.html].17" MacBook Pro, Mac OS X (10.6.6), iPhone 4
There are hundreds of processes that are not listed in Activity Monitor. You can only hope to see all of them from the Terminal application using 'top.' Unfortunately trying to add up memory usage is nearly an impossible task because the information is dynamic, not static.
Activity Monitor provides you with basic information on the amount of memory presently allocated to each of the four categories - Wired, Active, Inactive, and Free. AM re-counts that information once every 2 seconds (normally, unless you change the interval.) You are chasing after an ever changing number by adding up an incomplete set of data. Why?
It's a bad idea to disable the VM system. The page outs reported most likely page to nowhere since you have no swap file. This will just slow down the system as that information is not longer available to be paged in when needed.
Is there some particular reason why you are undertaking this exercise?Mac Pro 2.66 Ghz; MBP Unibody; MBP C2D 2.33 Ghz; 11" MBA, Mac OS X (10.6.5), iMac C2D 17"; MB 2.0 Ghz; iPad 32G; 80GB iPod Video; iPod Touch; iPod Nano 2GB
From Activity Monitor Help
Used memory is the sum of wired, active, and inactive memory. If the system requires memory it takes free memory before used memory.
However, Real Mem will contain some Shared memory, which means that several processes may be sharing the same page of memory. Libraries and Frameworks code are all shared amoung all the processes using those libraries or frameworks. So in theory some Real Mem will be counted multiple times in each app using that shared memory.MacBook/10.6.6, iMac/i7/10.6.6 w/Magic Trackpad, Mac mini/10.5.6, iPod Touch(4thGen)/32GB/4.2.1, iBook/G4, MacBook Pro/Core2Duo, iMac/Core2Duo
It's not the actual VM system that's disabled, but the swapping. With no swap, all pages are in RAM and the computer is much faster. I found the swapping more aggressive in Snow Leopard, and there was threshing even if there was enough free memory (free or inactive). This was even after my upgrade to 4GB of RAM.
Disabling the swap is not some kind of hack, it's just a unix command that tells the system not to load the swapper when the system boots up. I really do have a vast performance improvement, and all I have to do is check in a while and make sure the system has free memory.Macbook Pro, Mac OS X (10.4.8), C2D
Well, the swap is a major part of the VM system since a swap file and the hard drive form the basis for virtual memory. Disabling it is a hack because it is not disabled normally, and it requires your intervention to disable it. OS X does not provide the user with a means for disabling it unless you make an alteration to one of the system files that loads during startup.
In reality you are wasting your time on a non-issue by turning something that is nothing into something you believe is important. Re-enable the swap. Your memory is fine. You've provided no evidence there is even a problem.Mac Pro 2.66 Ghz; MBP Unibody; MBP C2D 2.33 Ghz; 11" MBA, Mac OS X (10.6.5), iMac C2D 17"; MB 2.0 Ghz; iPad 32G; 80GB iPod Video; iPod Touch; iPod Nano 2GB