Disk Cache

If you've read the page on virtual memory then you know that it's essential to make the best possible use of your physical memory to avoid slow hard drive access. The disk cache, also known as the file cache, is an all-important factor in making optimal use of your memory.

In a nutshell, Windows splits your physical memory into two sections: the cache and free memory. Free memory is the area where your programs run and where basically all the action is. So what's the cache for? Just remember this: old files never die, they just get cached. It may not be technically accurate, but it is kind of cute.

Let's say you launch your favorite word processing program. The program file, the document file, and any other required files like .dll or .ocx files get tossed into the free memory to be used. When you're done working and you close the program, the files don't all just get flushed out of memory and back to the hard drive. Some or all of them will get shoved into the cache instead.

There are several reasons for doing this. As was mentioned in the DLL document, some files are used by many different programs. It's probable that some files will be used a number of times during each computing session. It would then be very inefficient if those files had to be transferred to and from the slow hard drive every time they were needed. So sticking them into the cache is a way to keep them close at hand for quick access should they be needed, but keeps them out of the way of the work area of your memory.

To see this in action, start up a fairly large program, like a big word processing program, and see how long it takes to load. Now shut it down and immediately launch it again. Notice the difference? This is largely due to the fact that the files were all still readily available in the cache.

However, there is a problem with how the cache is handled. Typically when Windows controls the cache, which is the default setting, the cache starts out very small and grows as needed. Unfortunately is doesn't seem to ever want to shrink, but instead just keeps growing and growing until the bulk of your memory is taken up by potentially unnecessary files. The cache is a good thing, but not when it sucks up 90% of your memory. So CacheMaster allows you to set minimum and maximum sizes for the cache to keep it under control.

The tricky part is knowing what to set it at. The preset configurations are an attempt to provide for some common situations, but since every computer is different they shouldn't be considered the final word. Only through experimentation can you really find the right settings for your particular machine. However, there are some practical ideas to consider. First of all, the minimum size setting is not all that important. Under some circumstances there can be a benefit to setting the minimum and maximum to the same value, thus creating a constant cache size. This is typically done when you don't want to waste any processor power on resizing the cache, such as playing processor-intensive videogames. Otherwise, you can probably set the minimum at the lowest setting, or disable it completely.

The maximum size is the really important number. Before going any further, there are two important factors to consider. First of all, if you have more than 512 megabytes of RAM you should set a maximum cache size smaller than 512 megabytes. This is because Windows has a bug (imagine that) in the cache controller which can cause the world to end if it tries to make the cache larger than 512 megabytes.

The second factor is whether or not you have an AGP videocard. AGP stands for Advanced Graphics Port, and it provides a fast pipeline from the videocard to the processor and memory, as well as a few other little goodies. One of those goodies is the ability for the videocard to use your computer's memory more or less as if it was it's own memory. Often times it uses the cache memory for this, depending on the particular videocard and/or motherboard. The amount of memory that can be used in this fashion is set in your computer's BIOS and is called the AGP Aperture size. Typically this is set to 64 megabytes, but it can vary from 16 to 128 or sometimes more. It is advisable that you make sure you keep your maximum cache size larger than this aperture size, or else you can suffer slow video performance or even a good old system lockup.

Aside from those situations, a good rule of thumb is to set the maximum cache size to between 1/8 to 1/4 your total physical memory. It might be good to start with 1/8 and see how that works for you. The idea is to keep the swap file size and disk usage as low as possible. If you set the cache too large, then too much of your memory might be wasted on unused files. But if you set it too low your computer will have to be constantly shuffling files to and from the hard drive. You might lean toward a smaller cache if you typically run one or two big programs or big multimedia files, and lean toward a smaller size if you use a larger number of smaller programs and files.

Finally, there's the chunk size. Windows divides up the cache into sections, called chunks, to hold the cached files. The default chunk size is 1024 kilobytes. Larger chunk sizes will provide better performance since the files will be stored in larger pieces, but the downside is that a larger chunk size means a less efficient use of memory. Smaller chunk sizes make more efficient use of memory, but smaller chunks means more chunks which means more work for the processor.

If you have a faster processor but are short on memory, go with a smaller size. Adversely, use a larger size for a computer with lots of memory but a slower processor. Also, if you work primarily with large files and programs then you may benefit from a larger chunk size, and try a smaller chunk size if you work mostly with smaller files and programs.

In the end, experimentation is the key to finding just the right settings. So go at it and have a ball!

View Online Help

Back To Contents