Smart Computing ® Smart Computing ®
Top Subscribe Today | Contact Us | Register Now   
middle
Home | Tech Support | Q&A Board | Article Search | Subscribe & Shop   


Minding Your Memory With MS-DOS Email This
Print This
View My Personal Library

PC Operating Instructions
November 1994 • Vol.5 Issue 11
Add To My Personal Library

Minding Your Memory With MS-DOS

Jump to first occurrence of: [CONFIG.SYS]

MS -DOS users take note: You may not have to sing the "out of memory" blues ever again. You can tailor your PC's memory management configuration to increase its performance. You can actually make many improvements that will have an impact on both your computer's speed and its capacity to load more programs at once or work with larger data files.

And you can do much of it with good ol' MS-DOS. In this article, we're going to dispel some of the myths about memory management and those arcane DOS commands. We'll describe—with a minimum of techno-babble—what you can do to manage how your computer manages its memory.

We've outlined each of the ways you can manage your computer's memory with MS-DOS commands, so you can find out how to tailor your own system to suit your particular needs. Unless otherwise stated, all of these DOS commands and programs will work as we've described as long as you have Microsoft's MS-DOS 6.22 installed on your computer.



Buffers



The BUFFERS command is used to create a rudimentary disk cache on your hard drive. A disk cache is like a holding tank —a small portion of memory that holds information on its way to your hard drive in order to free up your computer's CPU (or microprocessor, the "brain" of your computer) for other tasks. The BUFFERS command will improve performance on all computers, but the effect is almost negligible on 386 or higher processors.

The BUFFERS= command line can be found in your Config.sys file, a file DOS consults every time you start your computer. To change your system's buffers, first make a backup copy of your Config.sys file. Then type edit config.sys at the DOS prompt and hit ENTER. Find the BUFFERS= line in the file and make any changes.

NOTE: You will need to save any changes you make to your Config.sys and Autoexec.bat files using the Save command in the File menu. Then reboot your computer for the changes to take effect. All suggestions in this article for changes to these files should be preceded by the making of a backup copy of the original file, and followed by saving and rebooting the system.

If you're using word processors or databases for the greater portion of your workday, set this BUFFERS= value to a low of 20 or a high of 50. The larger number makes heavyweight database programs like FoxPro and dBASE happy.

If you are using SmartDrive as a disk cache (SmartDrive is a disk caching utility that comes with Windows, Microsoft's graphical operating environment that works on top of DOS), you can reduce the number of buffers to fewer than 10 or delete the BUFFERS= command line entirely.

DriveSpace (the disk compression utility that comes with MS-DOS 6.22) users should limit the value assigned to the BUFFERS command to less than 48 under all circumstances. Using a higher value under this condition will cause DOS to load more programs "low" or into valued conventional memory (the first 640 kilobytes of random-access memory or RAM) instead of loading them into higher memory. Remember, you want to do all you can to limit the amount of "stuff" loaded into conventional memory because that's the memory that many programs and applications need in order to run.



CHKDSK



In addition to finding errors and fixing your hard drive, the CHKDSK command included with MS -DOS 6.22 will tell you how much conventional memory you had before your system loaded any programs, and how much free, conventional memory is now available.

To use the CHKDSK command, type chkdsk at the DOS prompt and hit ENTER. You'll get a list, in bytes, of your disk space and, at the bottom, the memory notations.



DEVICE



This DOS command loads programs that interpret your hardware's needs when you start your computer. Like BUFFERS, DEVICE is a line in your Config.sys file. The DEVICE command runs special programs that are meant to be kept running as long as your computer is turned on. For example, if you have a CD-ROM drive, you must load a device driver, a software program that will enable DOS to use the CD -ROM drive. The device driver acts as a go-between for your CD-ROM drive and your computer.

The DEVICE= command loads device driver programs into conventional memory, so it should be used sparingly unless you have knowledge that the program can't be loaded above the first 640 kilobytes (KB) of RAM. Check out the section on DEVICEHIGH below.

Bear in mind that some programs must be loaded using DEVICE=, since these programs insist on running below the 640KB conventional memory ceiling. SmartDrive is one of these programs, as are Himem.sys and Emm386.exe. We'll get to these other programs later.



DEVICEHIGH



DEVICEHIGH works just like DEVICE does. It's run from your Config.sys file, and it's made to load special programs and device driver programs into your computer's memory when you start up the machine. The difference between DEVICEHIGH and DEVICE is that the DEVICE command loads special programs below 640KB, where they compete for memory space with the actual programs you use to get your work done; the DEVICEHIGH command loads these programs into higher memory, out of the way of your applications. You should make every effort to load such programs as device drivers and mouse drivers using the DEVICEHIGH command instead of the DEVICE command. This will free up memory capacity for your word processors and spreadsheet programs that run from the DOS prompt.



DOS=HIGH/UMB/NOUMB



If you have a 386 computer (or higher), MS-DOS has the ability to load part of itself into strange regions of memory, reducing competition for memory with the programs you use to work and play.

The DOS= command in your Config.sys file does a couple of things for you. First of all, if you tack the word HIGH onto the end of that statement so that it reads DOS=HIGH, DOS will load part of itself into that unused memory region above 1,024KB. If you add UMB onto the statement so it reads DOS=HIGH,UMB, you place part of DOS into that no man's land and you give DOS the ability to load programs into the region of memory above 640KB, called the Upper Memory Area or UMA. In order to use the HIGH and UMA commands, you also have to load Himem.sys and Emm386.exe with the DEVICE= command in your Config.sys file. Himem.sys and Emm386.exe are driver files that allow DOS to use higher memory.



DOSKEY



DOSKEY is really a hard-core DOS user's tool. It's a program that keeps track of the last bunch of DOS commands you entered at the DOS prompt. DOSKEY is a terminate -and-stay-resident program, or TSR, which means you run it once, and it stays in your PC's cerebellum until you either tell it to hit the road or you restart your machine. DOSKEY creates a small workspace in your computer's memory to keep a short list of your most recent DOS commands. If you're the type to use very long, elaborate DOS commands that are a pain to have to remember, you'll love DOSKEY. DOSKEY first came with MS-DOS 5.0, and has been included with subsequent versions of MS-DOS ever since.

You can load DOSKEY by typing doskey at the prompt and hitting ENTER. Then you simply use the Up and Down arrow keys at the DOS prompt to recall the last bunch of DOS commands you used. Keep hitting these keys until you see the command you wish to reuse, then hit ENTER to invoke that command.



EMM386



EMM386 is a memory -management program included with MS-DOS 5.0 and higher. If you have MS-DOS version 5.0, the program itself is called Emm386.sys. In MS-DOS versions 6.0 and higher, it is called Emm386.exe.

EMM386 does three fundamental things for you. If you're using programs that must have access to a kind of memory called expanded memory, EMM386 will create and manage expanded memory for you. EMM386 is run from the Config.sys file immediately after the HIMEM.SYS statement, with a command statement that looks like this: DEVICE=EMM386.EXE.

EMM386 also serves two other purposes. As mentioned above, it's required in order to let DOS place programs above 640KB. If you want to be able to load programs "high" or into the Upper Memory Area (same thing) you need to make sure that the EMM386 memory management program is running.

To use EMM386 to help Windows run better, use this statement: DEVICE=EMM386.EXE NOEMS. This statement will empower DOS to give your Windows programs all the memory capacity that your computer has to offer.



FCBS



FCBS is an abbreviation for File Control Blocks. The FCBS= statement in your Config.sys file allocates a specific but tiny portion of your computer's memory to manage the files you work with.

Use this statement if you aren't using Windows: FCBS=10. If you're a Windows user, use this statement instead for best results: FCBS=16,0. The value before the comma gives DOS all that it needs to handle programs from the DOS prompt, and the value after the comma tells your computer that it doesn't need FCBS at all when Windows is running.



FILES



The FILES statement in your Config.sys file tells DOS how many files can be opened at the same time. Application programs like database management and word processing programs often use a lot of open files at one time. Use this statement if you're getting an error message from DOS that says you have too many files open: FILES=40.



Himem.sys



Himem.sys is a program that manages memory above one megabyte. Himem.sys creates a memory map called extended memory. Extended memory is required in order for many programs, including Windows, to run. Himem.sys came our way by virtue of the 5.0 release of MS-DOS. The version of Himem.sys that comes with MS-DOS 6 and up gives you more functionality than the original incarnation. Himem.sys in DOS version 6.2x also tests your memory chips for you every time you start your computer.



INSTALL



The INSTALL command helps you save a tiny bit of memory. The INSTALL command works like the DEVICE command does, with the exception that INSTALL is useful for loading programs that need no "environment space" in order to do their jobs. If you don't know about a program's needs for environment space, try using this command to load small executable programs from your Config.sys file during your computer's startup process. You would add the line



INSTALL=<program name>



after the last line of your Config.sys file.

NOTE: Don't bother with the INSTALL command unless you're getting "out of environment space" messages when you try to run your programs or applications from the DOS prompt.



LOADHIGH



The LOADHIGH command places memory -resident programs into the Upper Memory Area or UMA. By placing memory-resident programs, such as your mouse driver program, into the UMA upon system startup, you have the potential to save needed conventional memory space for your word processing and other application software. You can abbreviate LOADHIGH to LH if you choose, and you can use either LOADHIGH or LH to load a program into the UMA right from the DOS prompt. As an alternative, you can put the command LOADHIGH, followed by a space, before the line containing the name of the driver or TSR program in your Autoexec.bat file.



MEM



The MEM program is designed to give you a window into the soul of your computer . . . its memory banks. The MEM program will tell you several things about your computer's current memory status. First, it will list how much memory is being used from the different memory pools —conventional, upper, high, expanded, and extended. You can type mem at the DOS prompt and hit ENTER to find out how much of your different memory pools are being used and how much remains available.

If you'd like more detail, such as which programs are residing in these pools like so many fish living in so few ponds, type this command at the DOS prompt: mem /c, followed by ENTER. To view the portions of your memory pools that are free, type this command at the DOS prompt: mem / f followed by ENTER.



MemMaker



MemMaker is a program that comes with MS-DOS 6.x. MemMaker makes its living reviewing your startup files to determine the best possible order to load those programs into memory. Historically, there are quite a few software products that provide this utility. They are all categorized as "DOS Loaders."

MemMaker first reboots your machine to get a feel for the memory used by your startup programs, then it determines which areas of memory are as yet unused. Next, MemMaker tries to fit your startup programs into the most economical spaces available in your memory, optimizing memory space while doing so.

Typically, you run MemMaker a first time, getting major results in the form of additional free memory. You then run MemMaker each time you add, change, or delete a statement in your Config.sys and Autoexec.bat files . . . just to keep your computer's memory fine -tuned for maximum capacity.

If you're not using Windows, type this command at the DOS prompt to run MemMaker:



memmaker /batch /w:0,0



followed by ENTER. To run MemMaker properly if you're a Windows user, just type memmaker at the DOS prompt and hit ENTER. If you're using Stacker, DriveSpace, DoubleSpace or other disk-doubling software, add this statement to the end of either of these MemMaker commands:



/swap:<drive>

substituting the name of the real boot drive for <drive>.

A final word about MemMaker: You may be using hardware or software products that use multiple drivers or TSR programs in order to get their jobs done. We've seen voice mail/fax/modem cards that use five TSR programs loaded in a specific order just to be able to work properly. MemMaker doesn't know that the statements in your startup files may be functionally dependent upon one another. It will try to save memory and may in the process mess up the order in which these programs must be run.

By all means, run MemMaker to create more memory capacity for yourself, but make sure you test everything thoroughly before you revel in the gain.



Ramdrive



Ramdrive.sys is a program that will let you convert part of your computer's memory to a disk drive. Yes, that's right. If you can spare the memory capacity, you can create a "virtual" disk in your computer's memory. There are several reasons you might want to do this.

Firstly, RAM disks, as they're called, run your programs very quickly indeed. You simply have to create a RAM disk, copy a program onto it, and run the program from the RAM disk. If you use Ramdrive.sys to create a disk drive in your system's memory, your shell programs will indicate that this drive has a letter not unlike your diskette and hard drives.

If you're a Windows user, you'll most likely find that your programs are far too big and complex to be run from a RAM disk. Windows' use of .INI and other types of files located all over the place makes the chore of finding and copying all these files more trouble than it's probably worth. But character -based programs that can run from the DOS prompt benefit greatly in performance.

You can always create a small RAM disk and try it out to see if it's worth the hassle. Unfortunately, machines that benefit most from a RAM disk's improved performance usually don't have the memory capacity to spare for a RAM disk. If you can get your hands on a large capacity memory expansion card for your PC, you can use that card to create a RAM disk that will not cost you much in current memory capacity, but that will give you all the benefits of the speed of memory chips, which are faster than hard drives.

To create a RAM disk in memory, add this command statement to your Config.sys file: DEVICE=RAMDRIVE.SYS. A 64KB RAM drive is created if you don't specify the size yourself. For example, if you want a 1MB RAM drive (1,024KB), use this statement in your Config.sys file: DEVICE=RAMDRIVE.SYS 1024. If you have a 386 or faster microprocessor that has its memory chips configured to use extended memory, you can create a RAM drive in that extended memory by using this statement in your Config.sys file: DEVICE=RAMDRIVE.SYS /E. Don't forget to specify the size of the RAM drive you wish to create when creating a RAM drive in extended memory.



SmartDrive



SmartDrive (Smartdrv.exe) is one of the most useful programs to come down the pike in the MS-DOS package. SmartDrive creates and manages a special buffer in your memory that offloads information on its way to the hard drive from your PC's processor, freeing the processor for other chores. This feature works both ways, and for CD-ROM drives as well as hard drives if you own MS-DOS 6.x.

SmartDrive can be configured to improve the speed at which your hard drive or CD-ROM drive seems to work. You can decide how much memory is allocated to SmartDrive. The amount of memory handed to SmartDrive determines how well it works under DOS, Windows, or both.

To run SmartDrive to improve your hard drive's performance, you can add this statement to your Autoexec.bat file: SMARTDRV.EXE. To specify the amount of memory SmartDrive can utilize as a disk cache, use this statement: SMARTDRV.EXE 2048. The number 2048 is equivalent to two megabytes —a lot of cache for SmartDrive to work with, especially under Windows.

If you don't want to fuss with specifying the amount of memory that works best with SmartDrive, you can omit the size number in the statement and SmartDrive will peek at your computer's memory and take a set amount of memory for itself. If you have 2MB of memory, for example, SmartDrive will take 1MB for DOS programs and 256KB for Windows programs. If you have 4MB of memory, the program will take 1MB for DOS and 512KB for Windows. If you have 8MB or more, it will take 2MB each for DOS and Windows programs.

For best performance under Windows, you can reduce the amount of cache SmartDrive creates for Windows programs. For example, if your computer has four megabytes of memory, use this statement in your Autoexec.bat file: SMARTDRV 1024,256. The 1024 number tells SmartDrive to use 1024KB (1MB) of memory when Windows isn't running. The 256 number tells SmartDrive to allocate just 256KB, or a quarter of a megabyte, when Windows is running.



STACKS



The STACKS command is useful to DOS and Windows applications. STACKS are small areas in your computer's memory created to manage your computer's hardware. You should change this setting only if you see a DOS error message that reads "stack overflow."

For most users, there should be no need to change the way the STACKS statement appears in your Config.sys file. If you aren't running Windows, use this statement: STACKS=9. If you're using Windows, use this statement instead: STACKS=9,256. The number 9 in the statement (before the comma) denotes how much memory should be dedicated for managing hardware "interrupts" when running DOS programs from the DOS prompt. The number "256" determines how much memory is dedicated for STACKS while using Windows.

by Robert Mullen





Want more information about a topic you found of interest while reading this article? Type a word or phrase that identifies the topic and click "Search" to find relevant articles from within our editorial database.

Enter A Subject (key words or a phrase):
ALL Words (‘digital’ AND ‘photography’)
ANY Words (‘digital’ OR ‘photography’)
Exact Match ('digital photography'- all words MUST appear together)





Home     Copyright & Legal Information     Privacy Policy     Site Map     Contact Us

Copyright © 2010 Sandhills Publishing Company U.S.A. All rights reserved.