Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got Snow Leopard and 8G of RAM. Activity Monitor reports a VM size of 173 *Giga*bytes. My hard disk is only 250G and 200G of that is in use. I've got a lot more data than 27 GB on my hard disk. So the virtual memory size cannot really be 173GB, surely?

share|improve this question
    
I have 260 GB there, whoop whoop. –  slhck Apr 25 '12 at 11:03
    
VMware Fusion sometimes has petabytes or exabytes of virtual memory on my system. –  Daniel Beck Apr 26 '12 at 17:21

2 Answers 2

up vote 2 down vote accepted

Virtual memory is not completely occupied all the time. Your mac probably has set maximum limit for virtual memory to 173 GB.

That does not mean all 173 GB memory has been allocated. It will be allocated as per requirement.

I don't think more than 8 GB of it will ever be allocated unless you use some insanely RAM hungry application.

share|improve this answer
    
Well, according to Activity Monitor, the VM goes up and down, sometimes reaching 250G. There doesn't seem to be a maximum value. We must both be correct in saying that the VM as reported can't be actually used, and perhaps it is simply a glitch in Activity Monitor. Thanks for your reply! –  fairflow Apr 25 '12 at 11:11
    
Yup, there's no maximum defined, at least none that I know of. Unless you experience performance issues, no need to worry @fairflow –  slhck Apr 25 '12 at 11:15

I have a VM size of 350 GB.

The VM size does not actually reflect any resource in use, nor is it a limit. It is the sum of the address space sizes (ps -ax -O vsz will show these) for all running processes. The address space size is simply the largest number being used by that process to refer to locations in memory; memory below that value may not even be allocated to any purpose.

Here's just one example of why there would be such gaps:

Multiple programs may use shared libraries of code (also sometimes known as frameworks), such as Cocoa. In order to efficiently start up a program, these shared libraries are arranged so that each library on your system (mostly) is at a different virtual address — this means that when the program is loaded, its code that refers to the library can already point to that address and does not need to be rewritten with different addresses (relocation or dynamic linking). But not every program uses every library, so there will be gaps.

(I'm not an expert on these matters; some specific details may be off. Consider the above a guide to the sort of complexity that can exist in a modern system, not exactly how it actually does work.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.