Virtual memory is virtual. There is absolutely no relationship whatsoever between virtual memory and actual memory used.
There is no reason to worry or even care about how much virtual memory an application shows in activity monitor. It means absolutely nothing useful to an end user whatsoever. It is specious at best to say that it is useful even to an application developer.
The number doesn't represent anything real. It is virtual.
Most people can stop reading here, but for anyone interested, let me try to explain virtual memory in layman's terms.
Let's say application A starts up and requests 10k of memory from the OS. The OS gets the request, but is smart enough to realize that the application is probably going to need more than 10k so it allocates 1 meg but only gives 10k to the application. Now when a second request for 10k comes in the OS has less work to do. It's faster to allocate a larger block and "segment" it out than to allocate many smaller blocks one at a time. If application A requests 50 more 10k blocks of memory in a second, the OS will adjust accordingly to try to predict ahead of what the application needs.
Now, application B is also running, lets say it's a web browser. Let's say the user went to a web page with a bunch of large rez images and a flash application that added up are around 10 meg. Lets say this page has been open in the browser for at least 10 minutes.
The OS is constantly monitoring memory usage and adjusting for the best performance overall. So, when it see's that application B has a bunch of memory allocated but it hasn't used it in awhile (use means read or write to it), it decides to swap the memory to disk. So it writes it to disk and releases the RAM back for other applications to use. But application B doesn't have any idea this happened. Memory is memory to the application. It doesn't need to worry about it. The OS takes care of it.
Think of the OS memory manager like a valet. When the valet takes your car, it doesn't matter where it's parked so long as you get it back when you need it.
So, the OS is constantly tweaking and adjusting memory for all the applications that are running. It tries to think ahead and adjust so that all applications perform not only quickly, but efficiently as well. If efficiency were left to the application, a sloppily written program could ruin it for all the other applications, so the OS takes care of it and does it's best to make everyone happy, and generally speaking, does a good job of it.
So then the question arises, "If the virtual memory numbers are meaningless, why are they available at all". Excellent question. Look at it this way, if you were the developer of the activity monitor, wouldn't you want to show memory usage for an application? Of course. Unfortunately, the OS cannot provide you with the actual memory usage of the applications without spending a huge amount of time calculating it. Memory management is occurring constantly and it must be extremely fast. The algorithms that determine how memory is dealt with simply do not have time to keep "user friendly" accounting. All that matters to it is giving access to the memory to the applications that need it as quickly as possible, while maintaining ultimate efficiency of resources. So, the kernel developers that deal with memory management exposed the only numbers they had readily at hand, which is virtual memory. Which, in reality, are only meaningful to the memory manager, and almost completely useless to anyone else, but at least they can display something on the activity monitor.
That is a very simplistic description, but it's the best I can do in less than 4 hours of writing.
There is no reason to worry or even care about how much virtual memory an application shows in activity monitor. It means absolutely nothing useful to an end user whatsoever. It is specious at best to say that it is useful even to an application developer.
The number doesn't represent anything real. It is virtual.
Most people can stop reading here, but for anyone interested, let me try to explain virtual memory in layman's terms.
Let's say application A starts up and requests 10k of memory from the OS. The OS gets the request, but is smart enough to realize that the application is probably going to need more than 10k so it allocates 1 meg but only gives 10k to the application. Now when a second request for 10k comes in the OS has less work to do. It's faster to allocate a larger block and "segment" it out than to allocate many smaller blocks one at a time. If application A requests 50 more 10k blocks of memory in a second, the OS will adjust accordingly to try to predict ahead of what the application needs.
Now, application B is also running, lets say it's a web browser. Let's say the user went to a web page with a bunch of large rez images and a flash application that added up are around 10 meg. Lets say this page has been open in the browser for at least 10 minutes.
The OS is constantly monitoring memory usage and adjusting for the best performance overall. So, when it see's that application B has a bunch of memory allocated but it hasn't used it in awhile (use means read or write to it), it decides to swap the memory to disk. So it writes it to disk and releases the RAM back for other applications to use. But application B doesn't have any idea this happened. Memory is memory to the application. It doesn't need to worry about it. The OS takes care of it.
Think of the OS memory manager like a valet. When the valet takes your car, it doesn't matter where it's parked so long as you get it back when you need it.
So, the OS is constantly tweaking and adjusting memory for all the applications that are running. It tries to think ahead and adjust so that all applications perform not only quickly, but efficiently as well. If efficiency were left to the application, a sloppily written program could ruin it for all the other applications, so the OS takes care of it and does it's best to make everyone happy, and generally speaking, does a good job of it.
So then the question arises, "If the virtual memory numbers are meaningless, why are they available at all". Excellent question. Look at it this way, if you were the developer of the activity monitor, wouldn't you want to show memory usage for an application? Of course. Unfortunately, the OS cannot provide you with the actual memory usage of the applications without spending a huge amount of time calculating it. Memory management is occurring constantly and it must be extremely fast. The algorithms that determine how memory is dealt with simply do not have time to keep "user friendly" accounting. All that matters to it is giving access to the memory to the applications that need it as quickly as possible, while maintaining ultimate efficiency of resources. So, the kernel developers that deal with memory management exposed the only numbers they had readily at hand, which is virtual memory. Which, in reality, are only meaningful to the memory manager, and almost completely useless to anyone else, but at least they can display something on the activity monitor.
That is a very simplistic description, but it's the best I can do in less than 4 hours of writing.