Suggestions for Manual Optimization of Memory and Hard Disk storage Defragmentation

The Goal:
 * Increase performance, optimize machine and disk storage and help eliminate system hang problems.

The objectives:
 * Free up as much Conventional Memory (memory below the 640k line) as possible and leave this area available for programs/data that must reside in this space.
 * Free up as much Upper Memory (memory above the 640k line and below the 1Meg line line) as possible and leave this space for device drivers and data that must reside in this space.
 * Optimize the utilization of Extended Memory (memory above the 1M line).
 * Optimize the utilization of hard disk storage.

Supporting material you should read:
 * From the DOS Users Guide and DOS Command Reference:


 * Storage layout, and anything pertaining to memory and speeding up your system. Efficient utilization of memory and hard disk space is very important t* the overall performance of your  system.  Many programs that run on your computer are not always  efficient in their use of your system memory and hard disk storage. Periodic cleanup and system tuning will save you time and money.


 * DOS command DEVICE and DEVICEHIGH - Used to load your device drivers into memory


 * DOS command HIGHMEM - Manages the use of extended memory


 * DOS command EMM386 - Enables or disables EMM386 expanded memory support


 * DOS command LOADHIGH - Loads a program into upper memory.


 * DOS command RAMSETUP - starts the RAMBOOT setup program.


 * DOS command RAMBOOST - Increases available conventional memory and reduces the complexity of using DOS command EMM386.


 * DOS command DEFRAG - Reorganizes files on hard disk to optimize disk storage and performance.  (In DOS 6 and above)

Suggested clean up and tuning process:


 * Due to the many different systems and possible system configurations it is impossible to come up with one tuning/cleanup process that is perfect for all systems.  This suggested process should yield good results for all systems, however only you know what is stored on your system and what programs you will be running.  With the knowledge you acquire by reading the items recommended above and the knowledge you have about your system, you will understand the steps that follow and you will be able to fine tune this process to better fit your needs.

It is recommended that you go through this process:
 * Hard Disk defragmentation should be done periodically, in order to minimize the loss of contiguous space on your hard drive.
 * Whenever you add or delete a device on your system.
 * Whenever you upgrade (or downgrade) your system or make significant changes to your CONFIG.SYS or AUTOEXEC.BAT files.


 * Process:
 * Make a back-up copy of your CONFIG.SYS and AUTOEXEC.BAT files. If for any reason you are not satisfied with the results of this process you will be able to restore your system to it's original state.


 * Useful tip while modifying CONFIG.SYS and AUTOEXEC.BAT:


 * When the computer displays the message "Starting PC DOS ...", entering:


 * F5 skips the CONFIG.SYS and AUTOEXEC.BAT files and loads using a temporary default configuration.
 * F8 displays each command in your CONFIG.SYS file, pausing to wait for confirmation.It also gives you the choice on processing AUTOEXEC.BAT, and if Yes, pauses on each command there as well.


 * Edit your CONFIG.SYS file and insert the following line as the first line of your CONFIG.SYS file.

DEVICE=C:\DOS\HIMEM.SYS


 * This is the DOS extended memory manager. It is important to have this memory manager statement as the first statement in your CONFIG.SYS.You need to have the HIMEM extended memory manager up and running before any other items get loaded into memory.


 * Delete any "DEVICE=" statement line that contains the word "EMM386". EMM386 is the expanded memory manager and it is important to delete all EMM386 statements at this point in the process.EMM386 will automatically be inserted by the RAMSETUP step later in this process.


 * Save your changes, exit your edit session and reboot your system to make the changes active.


 * Bring up a DOS command line and enter the following command.

RAMSETUP


 * This should bring up a screen that tells you RAMSETUP will modify your CONFIG.SYS and AUTOEXEC.BAT files. Select OK.


 * Next you will see a screen stating that RAMSETUP needs to reboot your system. Select OK.


 * You will see several screens of information flip by as RAMSETUP reboots your system yet another time. Let it run until it completes.


 * With the RAMSETUP process complete go back and edit your CONFIG.SYS file and locate the lines that contain:

dos=high device=C:\DOS\HIMEM.SYS device=C:\DOS\emm386.exe .......other EMM386 parameters


 * Make sure the dos=high line is the first line in your file.
 * Make sure the HIMEM line is the second line in your file.
 * Make sure the emm386 line is the third line in your file.
 * Change "dos=high" to "dos=high,umb"


 * Delete or REM out the line "device=c:\dos\ramboost.exe load"
 * Change all "DEVICE=" to "DEVICEHIGH=" EXCEPT do not change the

HIGHMEM.SYS, EMM386 or SETVER lines. Leave them as "DEVICE=".
 * Save your changes and exit CONFIG.SYS


 * Edit your AUTOEXEC.BAT file.
 * Make sure "C:\tcpdos\bin\netbind" is the first line in your file.
 * Except for the first line mentoned above, wherever you start a program (such as "C:\mouse\mouse" or "C:\DOS\DOSKEY"), change the "C:" to "LOADHIGH C:...". LOADHIGH will attempt to load your programs into upper memory if the space is available. If the space is not available then your program will get loaded into conventional memory.
 * Save your changes and exit AUTOEXEC.BAT


 * You can review your current memory usage before you activate the changes made above by issuing the following command:
 * "mem /c" (use /p option to pause on each page)
 * Save this information so you can use after you reboot your system to compare how effective the above changes were for your system.


 * Reboot your system to invoke your changes.


 * Issue the command "mem /c /p" again and compare the results to your original values. As you make changes in the future, use this command to keep track of your progress.


 * Additional modifications can be made by varying the sequence of statements in AUTOEXEC.BAT. The gains are usually minor, but might be enough if your situation is very close.


 * If you work from within the DOS Windows environment, you could free up some additional memory with the following suggestions:
 * Remove PRINT.COM and use Print Manager under Windows.
 * Remove SHARE.EXE if you have VSHARE.386 under Windows.
 * Remove DOSKEY.COM if you don't use DOS command prompt under Windows.
 * Remove MOUSE.COM if you don't run DOS programs under Windows.


 * As the last step for those systems above DOS 5, you should now run the DOS DEFRAG command. DEFRAG is a hard disk storage file defragmentation tool.  Over time programs that run on your system read in and write out files to your hard disk storage.  While writing to hard disk your system looks for one chunk of disk storage large enough to contain your entire file.  Often the system cannot find one chunk large enough to contain your entire file.  When this occurs the system looks for fragments of available disk space.  When it finds enough available fragments, the system breaks up your file up and stores it across these available fragments.  The system maintains pointers to all these fragments so it knows how to reconstruct the file the next time a program wants to read it.  Pointers to all these fragments take up valuable storage and fragmented files on your hard disk result in additional work for your system and disk drive to read and write these  fragments.  The DEFRAG tool goes through your hard disk(s) and reconstructs files into single consecutive units of data on your hard drive(s) and it cleans up the fragment pointer tables.

This process will result in cleaning up conventional memory by moving as many programs into upper memory as possible and leaving conventional free for the programs that require it. It will also clean up fragmented files on your hard drive(s) which will result in faster system reads and writes from/to hard drive storage.

As mentioned above, this is a suggested process and is intended as a general process for a wide variety of systems and configurations. You will be able to obtain even better performance if you go over the recommended reading listed above and get to know what areas of storage the programs on your system are using.