The Why, When, Which, and How of Swapfiles (and 32-bit access) If you have a system that is capable of operating in enhanced mode (a 386 system with 2 Mb of RAM) you are singularly blessed with headaches and heartaches other Windows users do not need to concern themselves with. There are two features of Windows 3.1 that can bring on these ailments, swap files and 32-bit access. When operating in enhanced mode, Windows can swap data out of memory to a swap file on your disk when conventional memory becomes full. Essentially it is using hard disk space to provide additional memory or what is now called virtual memory. The swap files that take advantage of virtual memory can be temporary or permanent and typically they are created when you run Windows Setup. And there's the rub. The average user either is presented with the choice when the install Windows and have no idea what the considerations are or they received their machine with Windows pre-installed from the hardware vendor who made the choice for them. So what are the differences between temporary and permanent swap files? And how big should they be? And do you really need one at all? Are there any other considerations? (yes) When Steve House (76010,314) asked, ". . .right now with no swap file at all. Should I change that? What are the criteria used to make the decision?" Someone suggested, "Try a swap file see what happens. A perm swap file should perform better than a temp one." Hows that for an answer? And then there's that little 32-bit access box tucked away in the deepest recesses of the Control Panel. What's that got to do with anything? In a nutshell, if your system is operating in enhanced mode you may be able to take advantage of 32-bit access. 32-bit access allows your system to bypass the BIOS when shoveling information around. This improves performance, particularly when using DOS applications under Windows. However, not all systems can handle it. This is discussed in more detail below. The following Q&A addresses the issues to considered when implementing swap files and 32-bit access on systems that operate in enhanced mode. More likely than not, this means you. Q. -- What is the difference between a temporary and permanent swap file? A. -- Temporary swap files are dynamic. That is, their size fluctuates relative to the amount of hard disk space that is available on your system at a given time. If you select to create a temporary swap file, Windows will handle he size. If you elect to create a permanent swap file, Windows will analyze your system and recommend a swap file that is half of your current hard disk space. However,as Barry Schnur 70007,4653 noted in WFIL07, both the size of the drive and available RAM seem to be variables here. Generally, you would use a permanent swap file if you wanted to guarantee that a certain amount of space would always be availble as virtual memory. The other difference is speed. Permanent swap files take advantage of contiguous clusters and therefore tend to operate faster than temporary swap files. However the speed differential can be greatly diminished if you routinely defrag your hard disk. Q. -- Do I need a swap file at all? A. -- In general Microsoft tech support personnel are saying yes, but the most lucid and helpful advice we've found is Lenny Bailes who wrote in the April 28, 1992 issue of PC Magazine: "Generally, you will achieve the best performance under Windows by establishing a permanent swap file. This allows Windows to page information to and from disk faster than it would with a temporary swap file. However, you can make Windows run faster by disabling the swap file entirely. The drawback to this technique is that you will have no virtual disk memory and Windows will be limited to the extended memory available on start-up. If you have only 1MB to 2MB of extended memory available, you may get "out of memory" messages if you attempt to open more than one window for DOS. If you have plenty of extended memory available--say 8MB or more--or plan to run only one or two applications during a session, you should have no problems. Windows will definitely run faster without a swap file." Nat Bowman (75300,3127) of Microsoft Product Support Services also suggested considering the following: (1) The swapfile, be it temporary or permanent, is used when Windows requires additional RAM. If you have a lot of hard disk access while running your apps, you're probably running out of physical RAM. So Windows is swapping out code/data from physical RAM to virtual memory (the swapfile) to free up physical RAM. (2) Truetype (TT) fonts use RAM. Each time you start Windows, we build a font cache in RAM. Essentially, we are pre-building your TT fonts to give you the increased speed performance. If you have a lot of TT fonts loaded, this might also affect your RAM usage. As a test, you might compare your current free memory with TT fonts enabled vs when they are disabled. (3) Different apps use different amounts of memory depending on what you are doing, specifically, within each app. If you work a lot with bitmaps, high resolution graphics, and large palettes in one application, and I work with text and a few fonts in the same application, then you would definitely need the use of a permanent swapfile. NOTE: Use the Conrol Panel to make any desired changes in your swap file settings. DO NOT USE DOS COMMANDS to delete 386SPART.PAR, SPART.PAR, or WIN386.SWP from your hard disk. Q. -- How do I find out what type of swap file I have if any? How do I change my swap file settings? To view your current swap file settings: - Run the Control Panel - Double-click on 386 Enhanced - Click on virtual memory Your current settings are displayed. NOTE: If you are going to make a change, you should defragment your hard disk first--regardless of the type of swap file you are going to use. To change your settings: - Click on Change You can now change the drive on which your swap file resides. If you have more than one hard drive, put your swap file on the faster of the two. You can change the type of swap file or opt for "none." If you opt for a permanent swap file you can then specify the size. Windows will recommend a size that is half that is half of what is available. You can override the recommendation but keep in mind the following that nothings free. By setting up a permanent swap file you are restricting resources that may be needed by other programs at a future point in time (read Stacker -- for more information on this issue see the related question, What About Stacker). The permanent swap file you create will be given the name "386spart.par." Lastly, you will notice a 32-bit access box at the base of the screen. We'll talk more about this in a moment. Q. -- Can I put my swap file on a RAM disk? A. -- A lot of users have this question and it begs another -- Why would you want to do that? As Dave Aultman (72277,164) says, "it would be pointless to put the swapfile on RAMDISK, since you'd be using memory to simulate memory, rather than using disk space to simulate (increase) memory." But Windows users and their sense of curiousity is everwhelming. So for those of you who just got to know Nat Bowman (75300,3127) of Microsoft tech support refers you to KnowledgeBase article Q83583 Windows 3.1 Does Not Allow Swap File on Stacker Drive. The Stacker reference aside, this article states that "The Microsoft Windows operating system version 3.1 does not allow a temporary or permanent swap file to be set up on a STAC Electronics Stacker drive or a RAMdrive...." That's the official position. However, Mark Stevens (71357,233) of Entek Scientific tells you how to do it anyway. "The Windows control panel will not let you set a swap file to a ram drive but you can still do it. Set up a small TEMPORARY swap file on your hard drive and then exit windows. Edit your system.ini file and change the swapdrive or pagingdrive to the letter of your ram disk. This worked for me. It is true, however, that a permanent swap file can NOT be set to a RAM drive." Q. -- What concerns, if any, should I have when creating a swap file on a disk that has Stacker? The following is a synopsis of information that first appeared in WFIL07: If you want to use a swap file with Windows, you must set up the swap file on the uncompressed drive. When setting up Stacker, you can leave at least 1 megabyte (MB) of disk space uncompressed for storing system files. To leave enough space for the swap file, it is recommended that the amount of uncompressed disk space equal at least twice the amount of system memory. For example, if your system has 4 MB of memory, you should leave at least 8 MB of disk space uncompressed. Chuck Schwarts (70323,2072) said rather emphatically, "DON'T make the permanent swap file until after you run Stacker." Presumably the reason being that if you make the permanent swap file first there may not be necessary space for your stacvol, which is sizable. Q. -- Are there any problems I might encounter? A. -- Only if you don't do what you are supposed to. Clifford Tong (70761,674) had set up a permanent swap file and then in a "moment of desperation to get more disk space" backed up his swap file using PCbackup. Now when he starts Windows in enhanced mode he gets an error message that says his swapfile is corrupt (which is why you shouldn't use anything other than the Conrol Panel to modify your swap file settings). When he tries to start in real mode he receives a message saying that some program is running and has to be closed. Michael Weintraub (70033,751) suggested trying the following to put his house in order. "Edit (use SYSEDIT) your win.ini and comment out the load= and run= statements, exit, start win /R, do your swapfile stuff, uncomment win.ini lines, restart win, should work... " Q. -- What is the 32-bit access box for and why is it buried where no one can find it? Nat Bowman (75300,3127) of Microsoft techn support explains 32-bit access as follows: 32-bit disk access is a system of Windows components that allows Windows to talk directly to the hard drive controller, bypassing the BIOS. This is beneficial in that: (1) Disk access is speedier. (2) You can run more non-Windows apps (3) System speed is faster when running non-Windows apps in background I've noticed a speed improvement when the system is running with many apps open. It's not that noticeable under normal conditions, at least from my observations. What he doesn't address is why, if it's so nifty, they put it where no one can find it. Well, perhaps it is a reflection of the degree of confidence they have in it. After reading everything we could find we came up with the following facts: - When you run Windows setup it analyzes your system to determine if it can handle 32-bit access. If Setup finds that your system can handle it, the 32-bit access box will be availble and you can check it off. If it finds it can't, it will grey out this option. - The determining factor in whether or not you can use 32-bit access is the type of hard disk controller you have. Hard disk controllers that are 100% Western Digital 1003 compatible can safely accommodate 32-bit access. - The reason that the default is set to off can be summed up in an excerpt from Microsoft document "WW0530: SMARTDrive and 32-Bit Access." It states, "There are drives that appear to be WD1003 compatible but are not, and which cannot be detected by WDCTRL (the 32-bit access device). In addition, there can be problems even with compatible controllers on some portable computers, specifically those that power down the hard disk to conserve power without telling the running software. If the disk is powered down and then back up while it is being tracked by WDCTRL, the tracking information will be incorrect, and serious damage can result." So don't say we didn't warn you. Q. -- So how can I find out if my system is compatible? A. -- The only way to do it responsibly is to delve down into the Control Panel and see if the box is available. If it is, then back up your hard disk and check the box, and take advantage of it. We attempted to find out as much as we could. Needless to say most vendors simply repeated back to us what we already knew. Here is what we were able to find out. When Dennis Fowler (76217,34) ran Windows 3.1 with 32-bit access enabled on a Gateway 2000 386sx with 4 mb of RAM, a Seagate ST3144A 130 megabyte IDE hard drive, and a Silicon Valley IDE 16 bit card (ADP20), he received the erro message that the disk driver (WDCTRL) validation failed at phase 03, 00. To Microsoft's credit, they built in a fairly thorough error trapping routine that your system runs through. If it doesn't think that your system is compatible it will complain and refuse to cooperate as it did for Dennis. Chris Vega (70152,3066) reported that "I have a Seagate drive 3144a and I have been told that it is not supported by the western digital specification used by the win. 3.1. I have changed the box back to normal." Andrew J. Frankel (76117,2331) has a Plus Development XL105 Hardcard. He called Quantum/Plus Technical Support. "They said that the XL105 with the v1.70 ATDOSXL.SYS driver *does* support Win 3.1 32-bit Fastdisk access. They claim that they have several test systems running Win 3.1 with the XL105 and 32-bit Fastdisk access turned on with no problems." We contacted Dell Computer. Ron Clark (76702,1601) from Dell Technical Support states, "The only systems we do not recomend using the 32bit access on are the portable systems. The power saving features and Fastdisk are not completely compatable, there is a chance of drive corruption when the drive is returned from the Standby Mode. As for the D,P,DE,SE system models you can use the 32bit access successfully." We contacted other manufacturers but they didn't report anything conclusive. So on that note we will bid you adieu. If you want additional information on Swap files and 32-bit access the following Microsoft documents are helpful. WW0530 is very good. From the Microsoft KnowledgeBase (GO CIS:MSKB): DOC ID# - Q82730 "Why the Swap File is Written to at Startup in Windows 3.1" DOC ID# - Q82373 "Permanent Swap Files and the Disk Partition Table" From the Microsoft Software Library (GO CIS:MSL): WW0530.ZIP "SMARTDrive and 32-Bit Disk Access" WW0335.ARC "Memory Management with Windows"