Jump to content
cfsporn

Too much VM?

Recommended Posts

I recently upgraded to Leopard (after getting my MacBook fixed, Yay!!!) and am loving it, but one thing puzzles me: The activity monitor. Before, I knew what everything meant, but thanks to the addition of the VM size indicator, I am now confused. I always thought that VM=Swap file, but appearently I was wrong. Also how come it always says that such a large amount of VM is in used? Can someone please help me shed some light on this?

Share this post


Link to post
Share on other sites
I recently upgraded to Leopard (after getting my MacBook fixed, Yay!!!) and am loving it, but one thing puzzles me: The activity monitor. Before, I knew what everything meant, but thanks to the addition of the VM size indicator, I am now confused. I always thought that VM=Swap file, but appearently I was wrong. Also how come it always says that such a large amount of VM is in used? Can someone please help me shed some light on this?

 

I can attempt to shed some light on this, but please correct me if I'm wrong. The way virtual memory works, is that you only have so much RAM. Currently used processes are stored in physical RAM, but other applications that are open but not in use, get moved to virtual RAM. This is how come it takes a while for your Mac to do certain things, if you are trying to do something in an application you haven't used recently. If I'm not mistaken, the size of your virtual memory will change depending on how many applications you have open. The fewer number of applications, the smaller allocation of virtual memory you'll have. Hope this helps a bit. I would love to hear from someone else if they have a more intimate knowledge on this subject.

 

Edit: Also, this page might help

Edited by groomsy57

Share this post


Link to post
Share on other sites
I recently upgraded to Leopard (after getting my MacBook fixed, Yay!!!) and am loving it, but one thing puzzles me: The activity monitor. Before, I knew what everything meant, but thanks to the addition of the VM size indicator, I am now confused. I always thought that VM=Swap file, but appearently I was wrong. Also how come it always says that such a large amount of VM is in used? Can someone please help me shed some light on this?

The VM Size column is not new in Leopard. If you go to the View -> Columns menu, you'll see that you can show/hide a number of different pieces of information. One of them is "Virtual Memory". If it seems new to you, it's probably because you had turned it off in Tiger. (I think it's on by default.)

 

But there's a bug in Leopard. The numbers shown in the Virtual Memory column creep upward over time, becoming much larger than the VM the process is actually using. You can reset the values in this column by adding/removing any other column.

 

"Virtual Memory" is how much memory the process thinks it has. Some of this memory may be in RAM, some of it may be in the swap file, some of it may be on disk in other files. Some of it is visible only to this process, and some of it is shared across processes. (For example, you probably have several applications using WebKit. There's only one copy of WebKit in memory, but all of the applications using it count it as part of their virtual memory. It will never be written to the swap file, because it can always be reloaded as needed from the original code file.)

 

Any particular block of memory might be included in several of these categories, and/or within a category for several different processes; because of that overlap, it's difficult to add the numbers in any meaningful way, either within a row or within a column. The System Memory panel of Activity Monitor does show a total for the VM column, even though that's not a particularly meaningful sum. Leopard adds a "Swap used" total, which is meaningful.

 

You can see the size of the actual swap file(s) in terminal, with 'ls -h /var/vm'. (The -h flag is optional; it just makes the sizes human-readable.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×