RAM and SwapFile on Windows 9x and ME
Windows 9x / ME uses memory allocation very differently when you have more then 32 Megs of RAM installed. But what you may not know is that Windows changes the way it uses memory again after you have install more then 96 Megs. If you have plans on buying RAM or you have more then 96 Megs you need to read this page carefully. If you have less or are unable to reach the desired results on this page read this section.
Once you have installed more then 96 Megs of RAM Windows becomes a memory hog. I know, everyone tells you the more RAM you have the less resources you use; and the faster your computer is. Wrong! Let me prove this to you. We all know that RAM is at least 20 times faster then a Paging File, other wise know as a SwapFile (Virtual Memory). If your machine has 32 Megs (32,768kb) or less of RAM Windows fills the RAM with process information that is needed immediately. The rest is placed on your hard drive as a SwapFile. After 32 Megs Windows starts filling the RAM with other information that is called on demand. This is what makes your RAM valuable to you. It speeds up your computer, opening applications, cut and pasting, and these sorts of things. After 96 Megs, things really change for the worse.
If you have 96 Megs of RAM your normal Page is kept to a minimum until Windows reaches about 80% capacity of RAM. Your normal SwapFile size may be 44 Megs. Remember the Page is not the Size of the SwapFile, but rather the information inside the SwapFile. To help you understand this better, the SwapFile is like a large milk container that can be resized and any time to any size. A Page is the information that is being transferred from RAM to the SwapFile or SwapFile to RAM. And the Page size is the total amount of Page (memory allocated into either the SwapFile or back into the RAM Chips). The SwapFile does not always need to be full, just like the milk container. It can be half full or completely full, and if more space is required the Swap can grow.
Lets get started. Lets say that you have 96 Megs of RAM installed on you computer. Now you go out and buy another 32 Megs. You will see that your SwapFile's normal size is normally about 60 Megs and you are using you machine the same way as before. So now you figure that you need more RAM because the Page increased. So you buy another 128 Megs of RAM thinking that you can get rid of the SwapFile. WRONG, now your normal SwapFile size is about 70 or more. So you get another 128 Megs, this means you now have 384 Megs of RAM and now your normal SwapFile of about 180 Megs or more. So what do you do, buy more RAM? No!
In fact Windows uses up more resources with the larger amount of RAM. Let's go back for a moment. When you had 96 Megs installed you probably never ran out of resources unless you did not reboot for days on end. You have a SwapFile size that met you demands. You ran your programs and needed about 128 Megs total of memory, Windows used 90% of your RAM during high memory usage. Now with 384 Megs you should have more than enough RAM, but you are running out of resources, and you need a new hard drive just for your huge SwapFile. If you try and control the Cache, the SwapFile seems to get bigger.
So what does all this mean? It means either you save your money and get just the 96 Megs and follow the directions on setting up your SwapFile in the section below . Or you can buy more RAM and continue reading the section. In either case you are going to need to download QikFix and use the Memory Utilization Utility (MUU) that comes with QikFix.
The following has been tested on machines with 144 Megs, 192 Megs, 256 Megs and 384 Megs RAM.
After installing QikFix go to the Cache tab and clear the Cache setting by clicking on the "Set Defaults". Then in the Device Manager (System Properties) clear the Virtual Memory by setting the minimum SwapFile size to 0 and the Maximum to the maximum free space of the hard drive. Create a shortcut to the Memory Utilization utility (MUU) that comes with QikFix, and place it in the Startup folder. Then reboot. If you have 96 Megs or less installed you should follow the directions on setting up your SwapFile in the section below . If you have more then 96 continue on from here. Start the MUU and follow the directions. You will need to use the MUU for no less then 4 days of normal computer usage to get an accurate reading. If you already have used the MUU then find out what your Maximum Consumable RAM (MaxCR) is. We will call this the Original Maximum Consumable RAM (O_MaxCR). Once you have this number clear the MUU history and reboot. To view the MaxCR click on "Tell me about my computer's memory". The MaxCR will be posted on the second line.
Note the O_MaxCR is in the lower section. It is not in the window between "RAM in megabytes" and "Peak RAM". The upper window displays the current readings. The lower window displays accumulative information.
After rebooting, use your computer normally for a day. Before shutting down and going home look at the MaxCR (ignoring all other information). Calculate the required SwapFile (Virtual Memory File) size needed. The Virtual Memory symbol is VMF. If your RAM is equal to or greater than the O_MaxCR use this formula:
(RAM - O_MaxCR) / 30% = VMF
If your O_MaxCR is greater than your RAM use this formula:
(O_MaxCR - RAM ) * 1.2 =VMF
Add about 20 % to this just to play it safe.
VMF * 1.2 = NEW VMF
If the VMF was zero then set the maximum VMF to 20 Megs. If you have more RAM, than displayed in the RAM in megabytes Window then you do require O_MaxCR, make your NEW VMF size 10 Megs for now. Enter this amount in the Maximum Virtual Memory setting in the System Properties, set the Minimum to 0. Clear the history in the MUU and reboot. If you want to see just how Windows really does handle the memory allocation, set the Maximum to 33 reboot and take a look at the Paging size. Then set up the Virtual Memory to the 30 Megs and reboot. Now set the VMF using the formula above except use the MaxCR rather then the O_MaxCR for day 2. Clear the Setting in the MUU.
Note:If your MaxCR + VMF is greater then your RAM set the VMF to 50% of day 1 settings
At the end of day 2 you may notice that you are no longer running out of resources. The Maximum Memory as displayed in the MUU should now be at least 20 % higher then your MaxCR. The MaxCR should have even dropped a little on day 2. If day 2 readings show that you Maximum Memory is more than 20% of you MaxCR you need to recalculate the SwapFile.
Now you are getting the use out of your RAM. If you have 256 Megs or more you will get some real mileage out of the next few days. Windows will start freeing memory and resources, as they are not needed. Following this procedure will force Windows into clearing the memory of unused DLLs and information that is no longer needed.
Now on to day 3, setup day 3 using day 2's formula.
If you have enough RAM to support all your Windows memory needs you may have already noticed that Windows stopped using the SwapFile a short time after rebooting. You may now have 0,000 in the Paging size window soon after boot up. Now look in the Window "Largest Page" on the MUU. If the Largest Page + RAM is greater then the MaxCR lower the setting in the Virtual Memory manager (System Properties). Repeat this on day 4 and day 5 if needed. When using the MaxCR instead of the O_MaxCR leave the MUU open so that you can see the progress bars. This is needed so that you do not run out of memory. The SwapFile should be about 10 Megs and you may notice that the Paging size (depending on the amount of RAM) is 0,000
The idea here is to try and get the SwapFile size under 32 Megs if possible. If you have 384 Megs you will need to run day 3 formula for a few days to get a new O_MaxCR because your O_MaxCR may have been 512 Megs. Repeat day 3 steps until you have got Windows to lower its memory usage. Keep lowering the Maximum Virtual Memory a little each day.
Once you have found the actual size of the SwapFile (Virtual Memory File) size that is needed or at least close to it you should find that you do not run out of resources anymore. Windows is using most all your RAM before filling the SwapFile (Virtual Memory File). Windows will use the SwapFile (Virtual Memory File) during the boot up so I recommend leaving at least a small SwapFile (Virtual Memory File). And during the days that you are working on these settings always be sure to use a larger SwapFile (Virtual Memory File) than needed. Not too large, but at least 10% above the required size based on previous calculations
So let review this. Assuming that you have more RAM than the MAX CONSUMABLE RAM, you are only interested in 4 pieces of information for now; The O_MaxCR, the MaxCR, the Largest Page, and Maximum memory. This is the information you need to determine what size SwapFile you need.
When you play with these setting you will notice; for example: you have 256 Megs of RAM and your O_MaxCR is 292 Megs. You will notice that but day 3 the MaxCR is a lot less then the O_MaxCR
I have a machine with an AMD K-6 III 450, 256 Megs of RAM. My O_MaxCR was 256 Megs; the SwapFile was 78 to 90 Megs. More than 50% of my RAM was free. When I had 96 Megs my O_MaxCR was 128 with a SwapFile of 44 Megs, when I upgraded to 128 my O_MaxCR jumped to 192. Now after doing this I now have a 10 Meg Maximum SwapFile size and a zero Minimum with 0,000 Paging size and a 0,000 SwapFile size, zero pages, and a MaxCR of 160. MUU recommends that I have 128 Megs of RAM for optimal performance. And best of all I can see an increase in speed in the computer. My applications open much faster as does the start menu. Programs just seem to appear after clicking on them to start them. Word takes less than a second to open.
The odd thing is that the progress bar for the Paging file usage is about 50%. I would think that it is either 100% or 0% but Windows is reporting a 62% usage of a zero byte SwapFile with zero pages and zero Largest Page. I will let you know when I figure out what Windows is doing with this. After 3 hours of use this morning, having two Visual Basic editors running, Word, Front Page, an WS_FTP (software for uploading), the resource meter, Outlook Express email some large files (1.4 Megs each), the MUU, FatMon, and 3 Windows Explorers all running at the same time; my Free Memory is 95,756,000 and my RAM in total is 258 Megs (267,739,136) and a 0 SwapFile. Remember that a 128 DIMM is rated 128 but it could have a little bit more or less then 128 Megs. My resources are a little low, 18%. But that is to be expected with all these large applications running. Closing the FTP and the two Explorers, my resources jump up to 25%. Closing all applications except for Outlook, because I am still uploading files, and the resource meter, and the MUU my resources jump right back up to 76%. Windows is doing a great job of recovering my resources and my memory; I now have 115 Megs of Free Memory available. Shutting all programs down including my Dial Up connection and leaving just the resource meter running, Windows has recovered 86% of the resources.
This all means that before when I needed 256 Megs of RAM Windows was storing 94 Megs of unneeded information in memory, because now the MUU tell me my MaxCR is a 160 Megs.
I'll bet that most of you have QikFix or have tried QikFix and never realized what the MUU was all about!
One last note of caution; DO NOT make the "Maximum Memory" less then 10% of your MaxCR. If Windows runs out of memory it will lock up. Now what you need to do is set the Minimum SwapFile size, so read the next section.
Here is the first email about this page we received. And he's complaining? He has 256 Megs and before he would have run out of resources long before he got this many apps open!
"I have been able to make the computer holler for more memory! I tried to load Access, Excel, Word, Publisher, IE5.5, Outlook Express along with some 19 other applications in the startup folder & finally received the statement that not enough memory was available to load a program and to close an application and try again!! I was using a SwapFile of 15 Megs."
Setting Up a SwapFile
This information is basically for computer with less then 96 Megs of RAM. Although it can be used with any amount of RAM.
Step one is to add an entry to the System.ini file under the[386ENH] section: ConservativeSwapFileUsage = 1. But only add this entry if you have at least 64 Megs of RAM.
After installing QikFix go to the Cache tab and clear the Cache setting by clicking on the "Set Defaults".
Then in the System Properties- Performance tab, Virtual Memory button. set the Radio button to "Let me specify my own virtual memory settings". Clear the Virtual Memory by setting the minimum SwapFile size to 0 and the Maximum to the maximum free space of the hard drive. Click on let Windows manager the memory and then click on OK. Create a shortcut to the Memory Utilization utility (MUU) that comes with QikFix, and place it in the Startup folder. Then reboot. If you already have used the MUU, clear the setting first.
Run the MUU for at least 4 days of normal computer usage. At the end of the four days have the MUU set your minimum SwapFile size. The idea here is to reserve the space that the SwapFile normal occupies on the hard drive. This will help keep the SwapFile from becoming fragmented. And by setting the proper size Windows as the minimum amount of searching to do for the stored information. Well it is not really searching but the hard drive arm has less traveling to do so this means that the information can be retrieved quicker.