|
|
Optimizing DOS Memory (Updated 02-22-1998) If you have ever encountered an out of memory error, or didn't have enough memory to run a program (probably a game like Tie Fighter, Xwing, Doom2, Duke Nukem 3D, Quake, etc.), you might want to read the following for some pointers (even for those of you that only run Win95, Win98, or Win3.xx exclusively). Following the suggestions here should yield a single memory configuration that gives you enough base memory for all your application and gaming needs. For some systems, a multiple boot configuration is HIGHLY recommended. For how to implement multiple boot configurations, please see the DOS Multi-Config HOWTO. For other tune up advice, click on Tune Up. If you haven't already read the DISCLAIMER, please do so now! For copyright info, click on Help Me. My best advice is to just print out this page and go at it (PLEASE print on the back of scraps if possible and save a few trees). - See what some users had to say after optimizing the memory on their own.
- First off, this is not a page for users of MAGNA RAM, RAM DOUBLER, SOFT RAM, or any of those products that claim to increase (or double) your physical RAM via compression (of whatever sort)! Every single review that I've ever read has given the thumbs down on those products. The systems that I have seen running those products not only ran slower, but still couldn't open any additional applications. I have only one advice; and it's to buy more physical RAM if you're considering those products. Memory prices have dropped considerably, and you should be able to buy memory at about $2 per megabyte (60 ns EDO). Having said all that, this page contains lots of hints and suggestions for you to optimize and manage your EXISTING memory. If you've ever encountered that error message, the suggestions here will help you resolve it WITHOUT buying or adding additional memory to your system. Note: Adding more physical RAM to your system WILL NOT resolve your 'insufficient or out of memory error.' This error only pertains to your current memory configuration; though adding more RAM is never a bad idea and will make your system faster (especially if you run lots of memory hungry applications).
- If you don't want to spend anytime or energy thinking about your computer, but still want it running like a charm, you can purchase an advanced memory manager such as Quarterdeck's Extended Memory Manager or QEMM. A few simple clicks and you're done. Of course, the drawback is that you'll have to shell out cash (around $70), and it isn't 100% reliable (I get certain memory errors that QEMM says it doesn't cause, but I only get those errors while running QEMM. It may also slow down your windows performance (originally I had a link to a review from PC Magazine here, but it has since gone the way of the Dodo. You'll just have to trust me). However, QEMM is still your best solution if you want a painless, effortless solution to your memory problems. Personally, I recommend optimizing your own memory configuration. Side Note: You don't actually need the 630+K of base memory that QEMM provides. Anything above 575K is usually enough. I don't actually know of any DOS programs that require more than 575K. Further, despite what QEMM claims, your DOS programs won't actually run any faster with the tiny bit of extra base memory. Anything above 600K of base memory is probably more than you'll ever need. After optimizing my own memory, I get 622K free with everything loaded!
- Here are the ACTUAL config files on my machine!
- You can also run MEMMAKER, but I don't recommend it. As a matter of fact, I recommend against it highly! I don't personally know anyone who has been happy with MEMMAKER. If you insist on running MEMMAKER despite my advice, and you run into trouble, DON'T expect any help from me. The act of running MEMMAKER is generally an act of a desperate newbie (Don't worry, if you've already ran MEMMAKER, there is help for you yet. Read on.).
- If you're willing to spend a little time and effort to optimize the memory yourself, here are a few pointers (I'm no computer science major; these are just things that I've found to work. If something is incorrect or could be improved upon, please email
me): - Warning: Before you do anything else, back up your CONFIG.SYS and AUTOEXEC.BAT files. It's always a good idea to have backups of important files. If you want to be really safe, make a boot diskette by typing FORMAT /S A: and copying your CONFIG.SYS and AUTOEXEC.BAT files on to the floppy (while you're doing this, you might also consider copying (from the windows directory) your WIN.INI, SYSTEM.INI, other *.INI's. If you want to be really, really safe, you can also edit (and boot from) the files on the floppy instead of your originals and overwriting them once you get your system running exactly the way you want it (or renaming the originals to something like CONFIG.OLD and AUTOEXEC.OLD). This way, you also get an emergency rescue floppy disk as an added bonus (just make sure it's virus free by scanning it and then write-protect it after you're done making changes. NOTE: Win95 actually uses two sets of startup files (CONFIG.SYS/AUTOEXEC.BAT & CONFIG.DOS/AUTOEXEC.DOS). Generally, when you start up Win95, it uses CONFIG.SYS and AUTOEXEC.BAT. However, if you boot straight into DOS, it will use the CONFIG.DOS and AUTOEXEC.DOS. Strictly speaking, you do not need the .DOS files. If the .DOS files are missing, both booting schemes will default to CONFIG.SYS and AUTOEXEC.BAT.
Secondly, please DO NOT run MEMMAKER (I know that's what Microsoft tells you to do, but it doesn't perform anywhere near what it claims and fills your CONFIG.SYS and AUTOEXEC.BAT with lots of junk). If you don't believe me, back up your CONFIG.SYS and AUTOEXEC.BAT, follow the instructions here; write down the results. Restore your previous CONFIG.SYS and AUTOEXEC.BAT, then run MEMMAKER. Chances are, you'll have less free base memory with MEMMAKER. If you've already ran MEMMAKER, delete everything between LH and C:\. Don't fret, if things don't work right, you've got backups, remember? Besides, you can always rerun MEMMAKER to put all that junk back. - Okay, lets get to work. If you're not already running in DOS, you'll need to RESTART your computer and boot directly to DOS. Shelling out or quitting to DOS will give you incorrect memory usage readings!!!
Note: If you're running Win95, do yourself a favor and hit the F8 key during the boot-up (i.e. the 'Starting Windows 95...' part) and choose the Command Prompt Only option to save yourself for waiting for windows to load each time. Type MEM. If the largest executable program size is above 575K, you should probably leave well enough alone. Generally with sound, mouse, smartdrv, CD-ROM (and MSCDEX.EXE) drivers running, above 575K is a pretty good number. I believe that's the magic number where most games will run. - If you're below 575K, it's probably a sign that you're not utilizing your upper or high memory. The first thing to do is to edit your CONFIG.SYS to see if you're using high and upper memory. If you do not have a line that says something like: DEVICE=C:\WINDOWS\EMM386.EXE RAM, you should add it immediately after the line that says DEVICE=C:\WINDOWS\HIMEM.SYS (add this too if it is missing from your CONFIG.SYS). I know what some of you are thinking, that DOOM2 or certain games won't run with EMS memory. This is not true. If you let EMM386 manage all of your extended memory instead of specifying a specific size, those games should run just fine. Besides, it's the most optimal thing to do anyhow; if you find a number such as 1024 or any multiples thereof, you should remove it. If you find X=C000-C7FF (or anything like X=####-####) immediately after EMM386.EXE, the place to insert RAM is between EMM386.EXE and X=C000-C7FF. It's just a memory address that is supposed to be excluded from EMM386, typically memory being used by your graphics card. IMPORTANT NOTE: I've recently been informed that some versions of Win95 (the German and Danish OEM 2 release) come with a bug (there are many many more, but I'm only going to talk about this one in particular), that bloats up the size of HIMEM.SYS to occupy about 45K in your conventional memory (It should really only take about 1K; type MEM /C /P and look at the memory size for HIMEM.). If you find that your HIMEM.SYS is effected goto http://www.winhelp.dk/95h24.htm, where you can find more information and a patch file that will fix the problem.
- Before you move on, I want to say a few words about your UMB area. Unless you have some sort of special hardware installed in your system, you should be able to have an UMB area of at least 90K. Be careful about what you exclude from EMM386.EXE. Generally, the X=C000-C7FF is all you need. If you include other exclude statements (i.e. X=####-####) in your CONFIG.SYS, you may be unnecessarily reducing your UMB area. Also, during boot up, EMM386.EXE may not be able to detect all the available UMB area. It maybe necessary to add the include statement I=C800-CFFF to get as much UMB area as possible. If your UMB area is less than 90K, I would recommend adding the I=C800-CFFF statement. If your computer starts to behave strangely after adding the include statement, you should remove it. If you want to take a look at your memory map to know precisely what's available, you can use MSD.EXE. It should be already installed on your drive. Try using a dir msd.exe /s command from your root directory if you can't find it. If all else fails, you can download a copy of it at ftp://ftp.jcu.edu.au/pub/ibmpc/tools/Misc/msd.exe. Note: You should run MSD.EXE from a clean boot (i.e. choose Safe Mode Command Prompt) to get an accurate look at your memory usage. Just follow the legend in MSD.EXE. Everything should be straight forward. IMPORTANT NOTE: You may be tempted to add I=A000-BFFF as it may look available. The only thing I can say is DON'T!!! You should be satisfied at an UMB area of 90K or more. With all the stuff that I load into the UMB, I still can't manage to fill it. Go take a look at my config files and memory logs if you haven't already. YET ANOTHER IMPORTANT NOTE: Remember the RAM statement that I told you to add to the EMM386.EXE line? Technically, unless you really need EMS memory (games like Xwing or Tie fighter), you should really replace the RAM statement with NOEMS instead. Without getting into the details of why, NOT using EMS memory will free up AN ADDITIONAL 64K of UMB memory! My best advice is to just try it and see how your system runs. If you don't notice any software programs (only the really old, OLD! DOS programs) behaving strangely or refusing to run, then it is safe to use the NOEMS statement instead of the RAM statement. WITH the NOEMS statement instead of the RAM statement, my system has 154K of upper memory!
- Next, look for either a single line that says DOS=HIGH,UMB or two separate lines that says DOS=HIGH and DOS=UMB. If it is the latter, delete the two separate lines and type in DOS=HIGH,UMB where the first line used to be. If you cannot find either of those lines or if you find DOS=LOW (no kidding, I actually found this once), You'll want to type in DOS=HIGH,UMB somewhere (preferably immediately) on a line below EMM386.EXE. Now save, exit, reboot, then type MEM again to see how much memory is free.
- If you're still below 575K, the next thing to check is to see if you can load your devices into upper memory. Edit your CONFIG.SYS again and look for lines containing SETVER.EXE, IFSHLP.SYS, and DOSKEY.EXE. If these lines do not begin as DEVICEHIGH, change them from DEVICE to DEVICEHIGH. By the way, you CANNOT load the HIMEM.SYS and EMM386.EXE high using DEVICEHIGH so don't bother.
- You should also look for a line that contains SMARTDRV.EXE /DOUBLE_BUFFER (this only pertains to your CONFIG.SYS). In most cases, you should remove the entire line from your CONFIG.SYS. I've never seen a computer that has actually used the double buffering feature in SMARTDRV (if you're hesitant about removing this line, exit to DOS and type HELP SMARTDRV.EXE to read more about it). In every case that I've encountered, removing this line frees up memory and improves system performance.
- You'll probably find other lines that begin with DEVICE, what they load depends on what you have in your computer. Most likely, they're for your sound and your CD-ROM. It's probably a good idea to load them high by changing DEVICE to DEVICEHIGH. Important Note: Win95 users, unless you really know what you're doing, you should not be loading the real mode DOS CD-ROM drivers in your CONFIG.SYS (and the corresponding MSCDEX.EXE in your AUTOEXEC.BAT). This will free up a lot of base memory for most people. and the truth is that you simply don't need to load them if you only use Win95. If you need or want to be able to access your CD-ROM drive under DOS, then I HIGHLY recommend using a multi-configuration for booting. Here is the DOS Multi-Config HOWTO.
- You're pretty much done with your CONFIG.SYS. Another couple of things you can change are your FILES= and BUFFERS= statements. The higher the numbers, the more memory you take up. The highest number you'll probably want to set them to is 40. Anything beyond that is mostly likely excessive and unnecessarily high. Change them to FILES=40 and BUFFERS=40. Note: If you use a secondary disk cache such as SMARTDRV, FASTDISK, or Win95's Disk Cache, the BUFFERS=## is not necessary. The secondary disk caches are far superior and you can free up extra base memory by removing the BUFFERS=## statement (Microsoft actually recommends this; for more info, type "HELP BUFFERS" at your DOS prompt). Save, exit, and reboot. Type MEM again. See any improvements yet?
- You're half way done. It's time to edit your AUTOEXEC.BAT. If you're using win95, you'll want to remove the entire line that contains SMARTDRV.EXE. Win95 has its own disk caching program, and SMARTDRIVE interferes with it. If you're using windows 3.11 for workgroups (WFW), you'll want to set the cache size while running windows to 0. FASTDISK, the disk caching program for WFW should be used instead of SMARTDRIVE while running windows. FASTDISK is 32-bit, and SMARTDRIVE is only 16-bit (to read all the intricacies of how to set up FASTDISK, click here). You can set this by typing 2048 0 after SMARTDRV.EXE The first number 2048 is the size while running DOS, and the second number 0 is the size while running windows. If you only have 8 megs of RAM or below, you should probably set the first number to 256 if you want to play games like Doom2, DUKE NUKEM 3D, and the like (even a small cache size as small as 256 will make a huge performance gain in disk operations). Otherwise you'll get insufficient or out of memory errors. Note: Using a disk cache of 2048 (or 2 megs) with only 8 megs of total RAM is a bad idea in windows. As soon as you're out of physical RAM, windows will swap to disk. Taking up 2 megs of your physical RAM with your disk cache will slow your system performance to a crawl when all you've got is only 8 megs. Also, if you have a CD-ROM, find the line containing the MSCDEX.EXE statement, and make sure the line containing SMARTDRV.EXE occurs below MSCDEX.EXE. Otherwise SMARTDRIVE will not cache your CD-ROM. Also, SMARTDRIVE will automatically attempt to load itself into upper memory, so you'll want to delete LH from the line if it exists. While we're on the topic of SMARTDRIVE, if your system hangs or crashes often, it might be a good idea to turn off write-behind caching. It's suppose to improve system performance by writing to your hard drive when it's not busy. However, if whatever program you're running hangs or crashes before SMARTDRIVE gets a chance to write to your hard drive, the data is lost forever. You can turn off write-behind caching by typing /X or if you're running DOS 5.0, type A B C (and D and any additional drive letters if you've got additional drives, not including your CD-ROM) after the SMARTDRV.EXE statement. To turn off write-behind caching in Win95, while holding down the ALT key, double click on My Computer (or whatever you named it) then click on (let the ALT key go damn it! Set it free...) Performance then click on File System then click on TroubleShooting then check the box that says "Disable write-behind caching for all drives."
- If you have a line containing MSCDEX.EXE, you'll want to add /E before /M:##. It'll allow MSCDEX to utilize your expanded memory. Some people load the MSCDEX.EXE into upper memory by adding LH at the beginning of the line, though Microsoft discourages this. The reason is that loading MSCDEX into upper memory might slow down CD-ROM performance. It might be a good idea to remove LH from the beginning of this line. I personally don't load MSCDEX into upper memory, though I have done so in the past without noticing any performance difference. (shrug) You should probably try to load your mouse driver into upper (or expanded) memory before you try loading the MSCDEX into upper memory. Note: Win95 uses its own virtual drivers to access your CD-ROM, so strictly speaking, you could eliminate MSCDEX.EXE from your AUTOEXEC.bat (and the device driver from your CONFIG.SYS). Also, loading the 16-bit DOS CD-ROM drivers will force Win95 to run in MS-Compatibility Mode instead of protected 32-bit mode (meaning slower disc access). It is recommended that you remove (or REM) the lines containing your CD-ROM drivers and MSCDEX.EXE if you do not need to access your CD-ROM drive from DOS. However, if you exit from Win95 and want to read from your CD-ROM in DOS, you'll need to load MSCDEX (and the device driver in your CONFIG.SYS).
For how to implement multiple boot configurations, click here. - Unfortunately, I can't give you any advice about loading your mouse driver into upper (or extended) memory. The simplest thing to try is to type LH in the beginning of the line that contains MOUSE.EXE (it might also be MOUSE.COM or IMOUSE or LMOUSE). This might not work however. To be sure, you'll need to read the docs that came with your mouse. The readme files are typically in the same directory as your mouse driver. You can load Logitech mouse drivers into upper memory in your AUTOEXEC.BAT by typing /MEMU immediately after MOUSE.EXE (if you load the CLOAKING.EXE in your CONFIG.SYS, you can type /MEMSA /MEMA instead, to load your mouse driver into extended memory). Loading your mouse driver into extended memory (highly recommended) leaves only a 1K signature in your base memory! Note: You don't need to load a mouse driver if you only run windows (any version) exclusively. Windows load its own driver for your mouse (you can remove the mouse driver by deleting the the entire line that contains the MOUSE.EXE statement). However, if you want to use your mouse in your DOS programs, you'll need to keep this line. If you're looking for a driver for your mouse, take a look at http://www.drivershq.com/List/input.html.
- Save, exit, and reboot. Type MEM and see if you're above 575K. If you are, you're in good shape. Pat yourself on the back! If you're still below 575K, type MEM /C /P to see what's still taking up your conventional (base) memory. The only things that should be taking up your conventional memory are MS-DOS (or SYSTEM), HIMEM, EMM386, COMMAND, MSCDEX, and probably part of SMARTDRV (if you loaded SMARTDRV.EXE). Anything else taking up conventional memory probably should be loaded high. If you find the name in the CONFIG.SYS, you can load those high by changing DEVICE to DEVICEHIGH on the lines that they occur. If the names occur in your AUTOEXEC.BAT, then you can usually load them high by adding LH at the beginning of the lines on which those names occur. If those device drivers are loading in conventional memory despite the fact that you've instructed your computer to load them high, you could be out of upper memory or environment space. If during boot up, you see the error message OUT OF ENVIRONMENT SPACE, then you should add or change the line in your CONFIG.SYS that contains the COMMAND.COM and add immediately behind it /E:512 (probably something like shell=c:\dos\command.com /E:512 /P). If you're out of upper memory, there is no simple answer. You'll need to try various configurations of loading some device drivers into low and some into high till you get the most efficient use of your upper memory (i.e. if you have 16K of upper memory free, and a 25K device driver is loaded into your base memory because you're out of upper memory, you might want to unload a 10K device driver from your upper memory so you can load the 25K device driver instead). Note: The order that the devices are found (both in your CONFIG.SYS and AUTOEXEC.BAT) is also the order in which they are loaded.
- Well, after much consideration, I've decided to add a word or two here about how windows (3.xx and 95) handles virtual memory. I know that it may not really fit here, but seeing how they both concern memory and how no one ever really visit any other pages here, I thought I might as well mention it now. Well, my best advice is to set a permanent swapfile (about 100 megs if you could afford it, smaller it you need it, though it really shouldn't be smaller than 50 megs). Temporary swapfiles slow down performance and cause a whole lot more fragmentation on your drive affecting overall disk performance as well. The absolute best ideal situation is to give the swapfile its own partition so you'll never need to fiddle with it (i.e. worry about fragmentation). It is never, I repeat, NEVER a good idea to turn off virtual memory (I say this with 48 megs of physical RAM on my system). Win95 is so leaky and memory hungry you'll crash or run out of memory easily. Be sure to check out the Partition Scheme Hints.
- Well, I hope you've found this page useful. Email me if you've got suggestions or comments.
|
|