The Macintosh Guy || MacTips || Email Lists || My Blog


Virtual Memory and You.

If you look in your 'Memory' control panel you may see a number of options available to you. This week we are going to discuss Virtual Memory.

What is Virtual Memory (VM)? According to Apple Virtual Memory "...extends the user's available, physical random access memory by treating the hard disk - transparently to the user, with the exception of a slight loss of speed - as if it were additional RAM." What this means is that with virtual memory on, things that would otherwise be in RAM (Random Access Memory; e.g. the chips that are plugged into your Mac's mother board), are either left on, or placed on your hard drive. This can either be done through the Virtual Memory settings in your Memory Control Panel or through a third party product such as Ram Doubler from Connectix.

Why use VM? VM allows you to function as if you have more RAM than you actually do. This lets you either run more applications at once, or to run larger applications than you would without it.

What does VM really do? Virtual memory is more efficient on Power Macs than on Macintoshes with 68K processors but it basically functions on the same principles. VM places open applications that are not active and portions of active applications on your hard drive and only keeps what is necessary for functionality in real RAM. So whenever you switch the application you are using VM places the information from the active application on your hard drive and loads the new one into RAM.

On Power Macintosh computers VM enables what called File Mapping. File Mapping changes what happens when you launch a Power Mac native application. Without VM when you double click an application the whole application is loaded into RAM. This can involve large amounts of data. Netscape Navigator 3.0 for example suggests 12,254K just to launch the application. This compared to the 8 mb (just over 8,000K) that many Macs ship with makes one very aware of the need for another option. With VM when you double click an application only the essential parts of it are loaded into memory. So in our example of Netscape Navigator 3.0 your memory requirements are reduced by 3,254K.

To see how your favorite programs are affected by File Mapping select the application in the Finder and select 'Get Info' from the 'File' menu. Notice the note at the bottom of the Info window informing you by how much the memory requirements will be affected.

File Mapping is the one clear advantage of VM in that applications launch faster because there is less information that has to be loaded when you launch them.

What are some of the disadvantages of VM? All this moving of information from RAM to your hard drive and back to RAM again is a slow process. Also on Power Macs File Mapping means that all the needed information may not be loaded when the application is launched so it may need to be loaded from the hard drive later.

VM sets aside a portion of your hard drive the same size of what your virtual memory is set to. So if your VM is set to 24 M that is 24 megabytes of hard drive space that is taken up by an invisible VM storage file.

Also in my experience machines running VM seem to be a little bit more unstable and more likely to crash. (Usually with a type 11 Error) I am not saying that if you use VM you will be crashing left and right but it does make sense that the more information is being moved around there is chance for something to go wrong.

Below is a table of what I see some of the advantages and disadvantages of VM

 VM Advantages

 VM Disadvantages

 You can run more applications at once.  Applications run slower.
 You can run larger applications with less real RAM.  It takes more time to switch between applications.
 Applications may launch faster because of File Mapping.  Less hard drive space for your use.
You don't have to buy more memory.  Reduced system stability (in my opinion).

What about as Ram Doubler from Connectix? Ram Doubler 2 has some nice features. It has all the advantages of regular VM. It reportedly offers better performance that regular VM and also has the option of only using File Mapping and not the part of VM that writes information to you hard drive.

There are certainly situations where I can see that Ram Doubler would be attractive. It does have some nice features. However I don't think everyone should blindly go out and spend the fifty or more dollars for what it offers. I have listed the reasons below.

1. Real memory is always better. The only advantage that VM offers over real memory is that certain applications may launch faster. Personally I am willing to wait a few extra seconds for an application to launch if it will be faster once it is running. The wait is well worth it. Although a single application may launch faster, VM increases the time it takes to switch between applications so its still a trade off.

2. Ram Doubler will more than likely need to be updated every time I update my system software. This is not a principle that is limited to Ram Doubler. Any software that works closely with your system software is usually dependent on specific parts of that particular software, so when you change your system software it is very likely that you will need to update that software too. Much of my consulting business comes from people who simply need to update a piece of software that is causing them trouble because it is out of date. I say these kinds of software need baby sitting because the user needs to keep in contact with the manufacturer of that software to be notified if there is an update they need.

3. Real RAM has gotten real cheap! Many people can double their ram by just buying more. Many people are not aware that RAM prices have dramatically dropped in the past year. When I bought my 7200/90 about a year ago I was excited to get two 8 mb memory modules for $282 a piece from Kingston in a special offer. Today similar memory can be found for less that $50 each. Ram prices go up and down like any other commodity but prices are less that 25% of what they were less than a year ago. Check out RamWatch for weekly prices or The Chip Merchant is usually competitive and publishes their prices on the web. Newer Technology has a great free utility called GURU v2.0 which can help you find our what kind of RAM you need.

I have to use VM, how should I set it? If you have to use VM the general guideline is basically to only set it as large as you need it and no more. There is no real benefit to giving yourself lots of VM, remember the only "real" advantage is to be able to run more applications or larger applications. There are basically four ways that you might want to set your VM. They all relate to the amount of real ram you have which can be found under the Apple in the upper left hand corner of your screen in 'About This Macintosh...'

The amount next to either 'Built-in Memory:' (if VM is on) or 'Total Memory:' (if VM is off) is the amount of real RAM you have. If you see both, the smaller number is the amount of real RAM you have.

So how should I set mine? Look at the table below and see what area you fit into and set your Virtual Memory setting accordingly.

 Virtual Memory Setting

 The reason to set it that way.


 This is the setting for those who have plenty of RAM to do whatever they want. Usually anyone with 32 mb or more will choose this setting.

 On and set to 1M more than your real RAM.

 This is the setting for those who almost have enough RAM but run short occasionally. This will let you take advantage of File Mapping but won't slow you down too much from having to write large amounts of information to the hard drive.

 On and set to 50% more than your real RAM.

 This setting will allow you to significantly increase your capacity for running multiple applications but will still allow most of your applications to run in real RAM.

 On and set to twice your real RAM.

 This is getting to the high end of where you would want to set your VM. With this setting you are going to experience considerable decline in performance and simple tasks may take a considerable amount of time. If you feel the need to set your VM to larger than this you should really consider getting more real RAM to at least bring you to the point to where only doubling it will meet your needs.

The above table is simple a guide, it can often be helpful to alter the settings and see how it affects your personal use.

No matter where on the chart you are, you may notice a significant increase in performance to move up to the next level. Whether this is by simply adjusting your settings to follow a different level or through purchasing RAM to allow you to take the next step, you should notice a difference in your productivity by taking that step.

If you adjust your Virtual Memory, have questions about your system or the information above I'd love to hear about it or if you feel it helped you in any way.

The Macintosh Guy || MacTips || Email Lists || My Blog