home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / dos_util / pcl60b.zip / PART6.EXE / MEMORY.TUT < prev    next >
Text File  |  1993-07-13  |  34KB  |  652 lines

  1.        
  2.        ---------------------------------------------------------------- 
  3.  
  4.                        UNDERSTANDING AND MANAGING MEMORY
  5.  
  6.        ---------------------------------------------------------------- 
  7.        
  8.        With so much information to absorb, a tutorial on the topic of 
  9.        computer memory seems dry and uninviting. Computer novices and 
  10.        advanced users alike might be tempted to sidestep the topic of 
  11.        computer memory. After all, if you just want to USE the computer 
  12.        to accomplish a task isn't it enough to know that data is stored 
  13.        in either RAM (random access memory) integrated circuit chips or 
  14.        on a disk drive and leave the troublesome details to the 
  15.        computer? Hardly... 
  16.        
  17.        If you want to get serious about configuring your computer for 
  18.        speed, be able to switch between several software programs 
  19.        quickly, troubleshoot mysterious software problems or optimize 
  20.        your computer for larger data processing tasks - learning to 
  21.        manage memory is an ESSENTIAL survival skill. The tricks and 
  22.        reference ideas presented in this tutorial make the difference 
  23.        between a computer that simply does the job and a computer that 
  24.        flies through piles of work. Later in this tutorial we will 
  25.        present some unusual "power user" tips to manage computer memory 
  26.        effectively. But first, let's step back, take a breath a pull 
  27.        together a few basic concepts from previous tutorials. 
  28.  
  29.        Computer memory is divided into two types. Disk storage which is 
  30.        long term storage. And RAM (random access memory) which is short 
  31.        term storage. RAM is only active as long as power is supplied to 
  32.        the computer. In a physical sense, RAM exists within small 
  33.        integrated circuit "chips" housed within the computer. 
  34.        
  35.        A byte is simply computer-speak for a character of information 
  36.        within a RAM chip memory area of the computer. Think of a byte 
  37.        as a small filing cabinet drawer in a busy office. The letter 
  38.        "A" occupies one byte of information. A kilobyte is roughly 
  39.        1,000 bytes of information. Actually it is 1,024 bytes or the 
  40.        number two multiplied to the eighth power since computers deal 
  41.        in binary math. A kilobyte is actually a small amount of storage 
  42.        space - perhaps a short business letter in size. A kilobyte can 
  43.        be written as 1K. A megabyte is a million bytes - 1M written in 
  44.        computer shorthand. These terms are frequently abbreviated as 
  45.        kilo (or K), mega (or M) and giga (or G). You may also see KB 
  46.        for kilobytes or MB or MEG for megabytes. 
  47.  
  48.        Some memory storage areas of the computer cannot be changed, 
  49.        however. ROM or read only memory is also held in special 
  50.        computer chips. These chips do not lose their information when 
  51.        power is removed. ROM chips contain special startup instructions 
  52.        used when the computer is first turned on as well as specific 
  53.        instructions such as how to use the disk drives and computer 
  54.        memory. ROM memory is fixed. RAM memory, however, is flexible 
  55.        and can be configured to suit different needs.
  56.  
  57.        To make things a little more interesting, RAM is available in 
  58.        two "flavors". Dynamic RAM, sometimes abbreviated as DRAM which 
  59.        is relatively inexpensive and is the most common type of memory 
  60.        used in computers today. A second type, static RAM (or SRAM), 
  61.        is similar to DRAM but much faster in operation. Static RAM is 
  62.        usually configured for very fast "cache" memory which the 
  63.        central processor uses for temporary storage when DRAM would 
  64.        slow processing operations. Many computers do not contain SRAM 
  65.        and for the most part this tutorial deals with the management of 
  66.        dynamic RAM or DRAM; and this is where the majority of your data 
  67.        and software resides when the computer is operational. 
  68.  
  69.        To make the next jump in understanding we need to draw a map. 
  70.        Pay close attention, because understanding and managing this map of 
  71.        computer memory is where the secrets and tricks to boosting 
  72.        computer performance lie. We will dissect this map carefully in 
  73.        the paragraphs which follow... 
  74.        
  75.                   ------ A map of RAM computer memory ------
  76.  
  77.        
  78.          Conventional Memory       Upper Memory         Extended Memory
  79.                                              
  80.       0K                    640K                  1Meg                   
  81.       | ---------------------|--------------------|-------------------->
  82.        xxxx xxxxxxxxxxxxxxxxxx xxx xxx xxx xxx xxx xxx xxxxxxxxxxxxxxxxx       
  83.          |               |      |   |       |       |      | 
  84.          |               |      |   |       |       |      |
  85.          |               |    video | window for    | extended memory (XMS)
  86.        hardware code,    |          | expanded      | where software can
  87.        system data,      |          | memory (EMS)  | be relocated 
  88.        device drivers,   |          |               |  
  89.        memory resident   |      useful upper        |                   
  90.        programs          |      memory blocks       |      
  91.                          |      or UMB          high memory area
  92.                          |                      (HMA), the first
  93.                  free conventional              64K of extended
  94.                  memory: for programs           memory
  95.  
  96.        Tip: we will be referring to this map frequently so you might 
  97.        want a paper copy for frequent reference. Simply make sure the 
  98.        map is fully on your screen, turn on your printer and tap the 
  99.        Print-Screen key, sometimes abbreviated PrtSc or PrtScrn. If 
  100.        that does not work, try pressing the shift key (and hold it 
  101.        down) and then press the Print Screen key. Keep the map close by 
  102.        as our tutorial unfolds! 
  103.  
  104.        The above map of RAM memory looks technical and complex, but is 
  105.        actually quite simple. As we describe each section of the map, 
  106.        flip back and take a glance to refresh your "visual" 
  107.        understanding of this map. Once you understand this memory map 
  108.        you can "rearrange" how the DRAM memory of your computer is used 
  109.        for more effective, speedy computing! 
  110.  
  111.        The above map is analogous to a long wall of filing cabinet 
  112.        drawers. Each drawer can contain a computer piece or byte of 
  113.        information. Obviously, since we are dealing with millions of 
  114.        bytes this is a VERY long wall of filing cabinet drawers! Each 
  115.        filing cabinet has an address or location. The central processor 
  116.        in the computer also uses an addressing scheme to locate 
  117.        information in RAM memory. Note that the central processor in 
  118.        the computer can either read information from RAM or write 
  119.        information to RAM. RAM is somewhat like paper - it can store 
  120.        information. And the central processor holds a pencil and eraser 
  121.        so that it can read and write information as needed. 
  122.        
  123.        At the far left at 0K (zero thousand bytes of information) we 
  124.        notice that the RAM memory "filing cabinet drawers" store 
  125.        hardware code and system data including the MSDOS operating 
  126.        system itself. Normally device drivers and memory resident 
  127.        programs (TSR's) are stored in this area as well. 
  128.        
  129.        Moving to the right, next we see the free conventional memory 
  130.        where software such as a spreadsheet or word processor is held. 
  131.        This is the main memory area which concerns computer users and 
  132.        it is this area which can and should be maximized for effective 
  133.        computer use.
  134.        
  135.        Moving further to the right we see an important boundary exists 
  136.        at the memory location of 640K (640 kilobytes). It is here at 
  137.        the DOS 640K boundary that DOS does not normally allow a program 
  138.        to access further RAM memory. This is a design decision which 
  139.        was made when the first IBM desktop computer was manufactured 
  140.        and is based on the microprocessor selected at that time (8088 
  141.        CPU) and considerations of where to place video and disk drive 
  142.        memory access on those early machines. Although this 640K 
  143.        boundary was not meant to be crossed by software, clever memory 
  144.        management techniques will allow you to use RAM memory above the 
  145.        640K barrier. 
  146.        
  147.        Moving further to the right along the map we see the upper 
  148.        memory area which lies between 640K and 1 Meg. This memory is 
  149.        unique in that it is normally used to address hardware devices 
  150.        like your video monitor and disk controller which need a spot in 
  151.        memory to do their work. However some of this upper memory area 
  152.        can be reclaimed for other uses. One of the earlier schemes to 
  153.        reclaim this area was an memory management scheme called 
  154.        expanded memory sometimes abbreviated as EMS. 
  155.        
  156.        Finally, beyond the memory location at 1 Meg lies true extended 
  157.        memory which can be used for a variety of fascinating purposes - 
  158.        either actively by configuration of the user or passively by 
  159.        software which will detect and use expanded memory. Extended 
  160.        memory is abbreviated as XMS. Note that extended memory (XMS) 
  161.        can be installed in large amounts. A computer can have 2 Megs of 
  162.        memory, 4 Megs, 16 Megs and even more! The first 64K of extended 
  163.        memory is called the high memory area, sometimes abbreviated as 
  164.        HMA. 
  165.  
  166.        The secrets of memory management, then, lie outside or above the 
  167.        conventional 640K of RAM memory. Although 640K of conventional 
  168.        memory (640,000 bytes) sounds like a lot of RAM memory, today's 
  169.        advanced software uses memory voraciously! Let's pause for a 
  170.        moment and define the three specific types of memory seen above.
  171.  
  172.        CONVENTIONAL MEMORY. The first 640K of RAM memory. Conventional 
  173.        memory is used by applications software such as databases and 
  174.        word processors. It is sometimes called DOS memory. You can 
  175.        never have more than 640K of conventional memory due to the 
  176.        design of the original IBM PC. All PC clones share this 
  177.        conventional memory similarity. In order to use memory beyond 
  178.        640K you need to use special memory management software which is 
  179.        contained in later versions of DOS (versions 5.0 and 6.0) or a 
  180.        commercial or shareware memory management software package. 
  181.        Clever memory management can move some portions of DOS itself 
  182.        and the operating system out of conventional memory where it 
  183.        normally resided into upper or extended memory areas of RAM. 
  184.        This frees more conventional memory for use. Likewise, memory 
  185.        resident software programs and TSR's such as popup calendars, 
  186.        notepads and calculators can be moved out of conventional memory 
  187.        into upper or extended memory areas. 
  188.        
  189.        EXTENDED MEMORY. RAM memory which resides from the normal 1MB 
  190.        DOS limit to the top address limit of the CPU (central 
  191.        processing unit). This means to the top limit of the memory you 
  192.        have installed in the machine -  8 Megs of memory, for example. 
  193.        Using special software it is possible to convert extended memory 
  194.        to expanded memory. Extended memory is useful for software tasks 
  195.        like RAM disks, print buffers and other applications. Many 
  196.        software applications such as databases and spreadsheets can use 
  197.        extended memory for large tasks. Extended memory is also called 
  198.        XMS memory. 
  199.        
  200.        EXPANDED MEMORY. RAM memory which can be accessed only through a 
  201.        "window" or "page frame" set up inside the first 1 Megabyte of 
  202.        RAM. The usual limit of expanded memory is 32MB. Segments of 
  203.        this memory are quickly "paged in and out" of the memory window 
  204.        to create an illusion to the central processing chip of a large 
  205.        amount of memory - something like flipping the pages of a cartoon 
  206.        book to animate a story. Many applications such as spreadsheets 
  207.        and databases can use this memory to handle large tasks. 
  208.        Expanded memory is also called EMS memory. This type of memory 
  209.        is not commonly used today and was an early memory management 
  210.        standard. However, some software still supports this system. If 
  211.        you see references to LIM 3.0 or LIM 4.0 this is a clue that 
  212.        expanded memory can be used. Remember, extended memory can be 
  213.        converted to expanded memory using special software. Within DOS 
  214.        versions 5.0 and 6.0 a special software utility can make 
  215.        extended memory operate as expanded memory. This DOS utility is 
  216.        called EMM386 and only works on 80386 or higher central 
  217.        processors. Lotus, Intel and Microsoft Corporations (the letters 
  218.        of each company gave rise to the LIM specification) developed 
  219.        the early expanded memory management scheme when it was realized 
  220.        that early spreadsheets and other software needed more space 
  221.        than the existing 640K of conventional memory. 
  222.        
  223.        Of the two types, extended memory and expanded memory, today's 
  224.        software is usually configured to use extended memory if 
  225.        available. Even older XT computers, those using the 8088 
  226.        processor, can use expanded memory if an additional memory 
  227.        circuit board is installed. However XT class machines cannot use 
  228.        extended memory which is only available to machines using 80286, 
  229.        80386 and 80486 processors and their variants. 
  230.  
  231.        A concrete example to keep things simple. A customer might 
  232.        purchase a computer with 4 Megs or 4MB of memory. Of this, 640K 
  233.        is conventional memory. 384K is upper memory and the final 3M (3 
  234.        Megs) is extended memory. 
  235.  
  236.        Early XT class computers using the 8088 processor had only 640K 
  237.        of RAM or possibly 1 Meg of RAM. Users of AT class machines 
  238.        using the 80286 central processor frequently install between 2 
  239.        Megs and 4 Megs of RAM. Owners of computers housing 386, 386SX, 
  240.        486 or 486SX processors are able to access more than 16MB (16 
  241.        megabytes) of RAM. However, 4 to 8 Megs of RAM is considered a 
  242.        comfortable amount of memory on modern machines. A few "power 
  243.        users" may install 16 Megs or more of RAM memory. Note that XT 
  244.        computers using 8088 central processors cannot use extended 
  245.        memory. 
  246.  
  247.        Software programs that can run directly in extended memory are 
  248.        sometimes called DOS-extended programs. These types of programs 
  249.        can tell the central processor to switch to a special PROTECTED 
  250.        mode of operation for greater RAM memory access. Protected mode 
  251.        processors such as those based on the 80286, 80386 and 80486 can 
  252.        switch to protected mode to address greater amounts of memory. 
  253.        These processors switch from REAL mode into PROTECTED mode to 
  254.        address greater amounts of memory. The lowly 8088 processor used 
  255.        in the first IBM PC's operated only in REAL mode. Today many 
  256.        software programs use DOS extenders within their software code 
  257.        which allow computers to run in protected mode and thus address 
  258.        greater amounts of memory. 
  259.  
  260.        Although commercial software memory management utilities exist 
  261.        such as QEMM-386 and QRAM (from the Quarterdeck Company) and 
  262.        386MAX (from the Qualitas Company), DOS itself contains valuable 
  263.        software utilities to also accomplish the job. Note that users 
  264.        of DOS versions 5.0 and 6.0 have a variety of tools which can be 
  265.        used to configure memory for more efficient use. If you are not 
  266.        sure what version of DOS you have, simply type the DOS version 
  267.        command at the DOS prompt:    VER    <then press enter/return key>. 
  268.        DOS will tell you what version you are running. 
  269.        
  270.        The extended memory management utility program contained in DOS 
  271.        versions 5.0 and 6.0 is called HIMEM.SYS. It allocates and 
  272.        manages memory so that no two software programs try to use the 
  273.        same chunk of memory at the same time. A HIMEM.SYS statement is 
  274.        normally added to the CONFIG.SYS file which resides in the root 
  275.        directory of your hard drive. 
  276.  
  277.        Let's roll up our shirt sleeves and study HOW to manage memory. 
  278.        Be sure to glance at the memory map presented earlier in this 
  279.        tutorial to visualize what you are doing as this section of the 
  280.        tutorial progresses. Remember that many of these DOS commands 
  281.        and functions are ONLY found in DOS 5.0 and 6.0. Users of 
  282.        earlier versons of DOS can use special commercial and shareware 
  283.        utility software to emulate these functions if they do not own 
  284.        or wish to purchase DOS 5.0 or DOS 6.0.
  285.  
  286.        ---------------------------------------------------------------- 
  287.  
  288.                 THE DOS MEM COMMAND PRODUCES ESSENTIAL REPORTS
  289.  
  290.        ---------------------------------------------------------------- 
  291.           
  292.        If you are using DOS version 5.0 or 6.0 here is your first        
  293.        homework assignment. Use the MEM command to give you a report of 
  294.        the programs in memory, type of memory your machine contains and 
  295.        totals of each type of memory. At the DOS prompt type the 
  296.        command:     MEM /C    <then press enter/return key). A report 
  297.        will appear which contains useful information about the size and 
  298.        location of programs in memory. As you tinker with different 
  299.        configurations of memory run MEM /C from time to time to see how 
  300.        memory is used. Note that MEM actually has three command line 
  301.        switches of which MEM /C is the most useful. 
  302.        
  303.        If the report scrolls by too quickly use the DOS MORE command to 
  304.        slow it down. Type the following:   MEM /C|MORE 
  305.  
  306.        Want to print the report to paper? Try this:  MEM /C>PRN 
  307.        
  308.        Want the report printed to a small file for reading later? To 
  309.        create a report named CATFISH.TXT try this:  MEM /C>CATFISH.TXT     
  310.  
  311.        MEM syntax is:
  312.  
  313.        MEM [/CLASSIFY|/DEBUG|PROGRAM]
  314.  
  315.        Parameters:
  316.        
  317.        /CLASSIFY         Provide list of programs in conventional and 
  318.        or /C             upper memory
  319.        
  320.        /DEBUG            Provide list of programs and device drivers
  321.        or /D             loaded in memory
  322.        
  323.        /PROGRAM          Provide list of programs in memory
  324.        or /P
  325.  
  326.        The /C parameter switch is perhaps the most useful for 
  327.        determining contents of upper memory and may called from a batch 
  328.        file such as AUTOEXEC.BAT to confirm critical upper memory every 
  329.        time your machine is started!
  330.  
  331.        Be sure to run the MEM /C command from time to time as you 
  332.        tinker with memory. This is VITAL to achieving optimum memory 
  333.        configuration. 
  334.                 
  335.        ---------------------------------------------------------------- 
  336.  
  337.                   TINKERING WITH CONFIG.SYS AND AUTOEXEC.BAT
  338.  
  339.        ---------------------------------------------------------------- 
  340.        
  341.        The key to tinkering with memory is to rearrange the commands 
  342.        within two files usually stored within the root directory of 
  343.        your hard drive. These special configuration and start up files 
  344.        are CONFIG.SYS and AUTOEXEC.BAT. They are discussed in the 
  345.        advanced DOS tutorial and the batch file tutorial in a earlier 
  346.        section of PC-Learn so you might want to read those two 
  347.        tutorials a second time to brush up a bit before proceeding. 
  348.        
  349.        To change the commands and statements within CONFIG.SYS and 
  350.        AUTOEXEC.BAT we need a text editor or word processor - DOS 
  351.        versions 5.0 and 6.0 provides a simple editor called EDIT.COM. 
  352.        To load a file named CONFIG.SYS into the editor simply type the 
  353.        command:   EDIT CONFIG.SYS. For hard drive users, since 
  354.        CONFIG.SYS usually resides in the root directory of the hard 
  355.        drive, the command might instead be EDIT C:\CONFIG.SYS. Then you 
  356.        can change and rearrange statements in the file. When you are 
  357.        done tinkering simply use the editor to save the file back to 
  358.        disk in the newly revised version. 
  359.        
  360.        Be SURE to save a spare copy of both CONFIG.SYS and AUTOEXEC.BAT 
  361.        on a spare floppy disk just in case your tinkering leaves your 
  362.        machine operating poorly. If necessary you can then reboot the 
  363.        computer from a fresh copy of DOS on floppy disk and then recopy 
  364.        the old versions of CONFIG.SYS and AUTOEXEC.BAT back to the hard 
  365.        drive root directory. If you are using your word processor to 
  366.        affect changes in CONFIG.SYS or AUTOEXEC.BAT be sure to save the 
  367.        file in pure ASCII format and not WordPerfect or Microsoft Word 
  368.        format! 
  369.  
  370.        Let's get to work...
  371.  
  372.        Assuming you have a computer with 80286, 80386 or 80486 processor 
  373.        and MORE than 1 Meg of RAM memory you can load DOS itself into 
  374.        the high memory area. You must be running DOS 5.0 or 6.0 to use 
  375.        this trick. Add the following two lines as the FIRST two 
  376.        statements of your CONFIG.SYS file:
  377.  
  378.        C:\DOS\HIMEM.SYS
  379.        DOS=HIGH
  380.  
  381.        When you have done this, reboot your computer to let the revised 
  382.        CONFIG.SYS take charge! Test available memory by running the test 
  383.        utility    MEM /C.
  384.  
  385.        HIMEM.SYS is the high memory manager of DOS. The two lines given 
  386.        above must be placed as the FIRST lines before other upper 
  387.        memory mangers or statements within the CONFIG.SYS file (for 
  388.        example, before EMM386.EXE is loaded). The command DOS=HIGH 
  389.        tells DOS to load itself in the high memory area. 
  390.            
  391.        ---------------------------------------------------------------- 
  392.  
  393.                           LET'S TINKER WITH THE UMA
  394.  
  395.        ---------------------------------------------------------------- 
  396.        
  397.        Memory resident programs, also called TSR's (terminate and stay 
  398.        resident software) can also be moved out of conventional memory 
  399.        into the UMA (upper memory area) of extended memory. This is 
  400.        done by using the software utility found in DOS 5.0 and 6.0 
  401.        called EMM386.EXE. Note that EMM386.EXE will ONLY work on 80386 
  402.        and 80486 computers (as well as their close cousins, the 80386SX 
  403.        and 80486SX computers). 
  404.  
  405.        We will add another line or so to the CONFIG.SYS file to 
  406.        accomplish this. Note that you can add several parameters to the 
  407.        EMM386 command. The command has several variations. For example, 
  408.        you might want to tell EMM386 to NOT create expanded memory from 
  409.        extended memory. This is done by inserting the following command 
  410.        in the CONFIG.SYS file and then rebooting the computer:
  411.  
  412.        DEVICE=C:\DOS\EMM386.EXE NOEMS
  413.  
  414.        Note the word "NOEMS" which sets the computer so that extended 
  415.        memory is NOT used for expanded memory. However, if you want to 
  416.        convert 2 MB of extended memory to expanded memory and also want 
  417.        EMM386 to manage DOS programs in extended memory add this 
  418.        command to CONFIG.SYS:
  419.  
  420.        DEVICE= C:\DOS\EMM386.EXE RAM 2048
  421.        
  422.        ---------------------------------------------------------------- 
  423.  
  424.                  LET'S LOAD TSR'S AND DEVICE DRIVERS INTO UMA
  425.  
  426.        ---------------------------------------------------------------- 
  427.        
  428.        Let's load device drivers and TSR programs into the upper memory 
  429.        area (UMA). First, run the MEM /C command and study the report. 
  430.        Find the entry marked "largest available upper memory block". 
  431.        Next determine the size of the largest device driver listed in 
  432.        the conventional memory list that could fit into this vacant 
  433.        space in memory. Let's say that somewhere in your CONFIG.SYS you 
  434.        are using the device driver ANSI.SYS which is currently loaded 
  435.        into the conventional memory area. To send it into the upper 
  436.        memory area CHANGE this command in CONFIG.SYS: 
  437.  
  438.        DEVICE=C:\DOS\ANSI.SYS               
  439.        
  440.        to this new command:
  441.  
  442.        DEVICEHIGH=C:\DOS\ANSI.SYS
  443.  
  444.        Reboot the computer, run the MEM /C command and study the 
  445.        result. As you locate areas in upper memory which are free, try 
  446.        to tuck device drivers such as ANSI.SYS and others into upper 
  447.        memory by modifying the     DEVICE=     statement into the
  448.                                DEVICEHIGH=     statement.
  449.  
  450.        Device drivers such as DOSKEY, GRAPHICS, and MOUSE drivers can 
  451.        all be loaded into upper memory using this tip!
  452.  
  453.        You further modify this technique by adding the following 
  454.        statement to the DOS=HIGH command that we placed in CONFIG.SYS. 
  455.        
  456.        Instead of seeing this statement:          DOS=HIGH      
  457.        
  458.        We would see this statement:               DOS=HIGH,UMB
  459.        
  460.        This modification tells DOS that programs are loaded into the 
  461.        upper memory blocks (programs such as the mouse driver or 
  462.        ANSI.SYS, that we discussed) and that DOS should maintain a sort 
  463.        of "memory link" to them. If you forget to add this switch 
  464.        (,UMB) then DOS will load the devices high into upper memory but 
  465.        will NOT be able to operate them since it does not know they 
  466.        have been relocated. 
  467.  
  468.        Be sure to use the MEM /C command from time to time to see how 
  469.        you are doing on memory optimization. Be sure to reboot (or 
  470.        restart) the computer each time you make a modification to see 
  471.        the results. 
  472.  
  473.        A curve ball! This method works for device drivers (like the 
  474.        mouse driver or ANSI.SYS), but what can be done if you want to 
  475.        load a TSR program (terminate and stay resident - popup program) 
  476.        into upper memory? Instead of the DEVICEHIGH=   command inside 
  477.        the CONFIG.SYS file, use a different command: LOADHIGH. But be 
  478.        careful! The LOADHIGH command is used ONLY in the AUTOEXEC.BAT 
  479.        file, NOT in the CONFIG.SYS file. For example, a computer user 
  480.        might be running the TSR program DOSKEY which is a useful macro 
  481.        processor found in DOS versions 5.0 and 6.0. Instead of this 
  482.        command in the AUTOEXEC.BAT:    DOSKEY    the following memory 
  483.        efficient command might be used in AUTOEXEC.BAT:   LOADHIGH DOSKEY 
  484.        
  485.        ---------------------------------------------------------------- 
  486.  
  487.                     BEFORE AND AFTER OPTIMIZATION: EXAMPLES
  488.  
  489.        ---------------------------------------------------------------- 
  490.        
  491.        Sometimes it is helpful to study actual examples of memory 
  492.        optimization. With that in mind, listed below are some sample 
  493.        CONFIG.SYS and AUTOEXEC.BAT files both before and after memory 
  494.        optimization. Remember that these two files normally reside in 
  495.        the root directory of your hard drive    C:\   Be sure to save 
  496.        your original files on floppy in case you your tinkering 
  497.        produces unworkable results. 
  498.  
  499.        CONFIG.SYS  (BEFORE OPTIMIZATION)
  500.        
  501.        DEVICE=C:\DOS\ANSI.SYS
  502.        FILES=20
  503.        BUFFERS=30,8
  504.  
  505.        CONFIG.SYS  (AFTER OPTIMIZATION)
  506.  
  507.        DEVICE=C:DOS\HIMEM.SYS
  508.        DOS=HIGH,UMB
  509.        DEVICE=C:\DOS\EMM386.EXE NOEMS
  510.        DEVICE=C:DOS\SMARTDRV.SYS 1024 2048
  511.        DEVICEHIGH=C:\DOS\ANSI.SYS
  512.        FILES=20
  513.        BUFFERS=30,8
  514.        
  515.  
  516.        AUTOEXEC.BAT  (BEFORE OPTIMIZATION)
  517.        
  518.        PROMPT $p$g
  519.        PATH C:\;C:\DOS;\C:\GAMES
  520.        C:\DOS\DOSKEY.COM
  521.        C:\DOS\MOUSE
  522.        
  523.        AUTOEXEC.BAT  (AFTER OPTIMIZATION)
  524.  
  525.        PROMPT $p$g
  526.        PATH C:\;C:\DOS;\C:\GAMES
  527.        LOADHIGH C:\DOS\DOSKEY.COM
  528.        LOADHIGH C:\DOS\MOUSE
  529.        
  530.        ---------------------------------------------------------------- 
  531.  
  532.                                  MORE EXAMPLES
  533.  
  534.        ---------------------------------------------------------------- 
  535.        
  536.        Here is a typical minimal CONFIG.SYS for a 80286 computer having 
  537.        only 1 Meg of memory:
  538.  
  539.        DEVICE=C:DOS\HIMEM.SYS
  540.        DOS=HIGH
  541.        DEVICE=C:\DOS\SMARTDRV.SYS 256 128
  542.        FILES=20
  543.        BUFFERS=4
  544.        STACKS=0,0
  545.        
  546.        The first line loads the memory manager HIMEM.SYS which works 
  547.        only with 80286, 80386 or 80486 machines. Line two loads DOS 
  548.        into high memory. Line three loads the hard disk cache which 
  549.        comes with DOS, SMARTDRV. 256 is the maximum size for the disk 
  550.        cache and 128 is the minimum size. If only one number is given 
  551.        this is automatically the maximum size for the cache. The next 
  552.        line means that up to 20 DOS files can be open at one time. The 
  553.        next line referring to buffers allocates memory for data to be 
  554.        retrieved from the disk drive. Buffers can probably be decreased 
  555.        since SMARTDRV.SYS performs many of the same functions as 
  556.        buffers and is faster. The final statement referring to STACKS 
  557.        allows even more memory to be squeezed from the machine. Most 
  558.        programs should run fine with STACKS=0,0 but if some programs 
  559.        lock up you can remove this line. Any references to EMM386.EXE 
  560.        are omitted from this CONFIG.SYS because 80286 based machines 
  561.        cannot use that utility.
  562.  
  563.        Next, a typical CONFIG.SYS for a more powerful 80386 or 80486 
  564.        machine.
  565.        
  566.        DEVICE=C:DOS\HIMEM.SYS
  567.        DOS=HIGH,UMB
  568.        DEVICE=C:\DOS\EMM386.EXE NOEMS
  569.        DEVICEHIGH=C:\DOS\SMARTDRV.SYS 256 128
  570.        FILES=20
  571.        BUFFERS=4
  572.        STACKS=0,0
  573.  
  574.        The interesting differences here are that the EMM386 memory 
  575.        manager is loaded including the ,UMB switch. Also the DEVICEHIGH 
  576.        statement is used to load SMARTDRV.SYS driver high.
  577.        
  578.        If you have a 80386 or 80486 machine with at least two megabytes 
  579.        of memory or more you can increase the SMARTDRV.SYS statement 
  580.        from this:        SMARTDRV.SYS 256 128
  581.        to this:          SMARTDRV.SYS 1024 256
  582.        This increases the size and performance of the SMARTDRV system 
  583.        which your hard drive uses.
  584.  
  585.        Conversely, if you run Windows 3.1 and have trouble running in 
  586.        a higher mode you might change SMARTDRV.SYS to this:  
  587.        SMARTDRV.SYS 128
  588.  
  589.        ---------------------------------------------------------------- 
  590.  
  591.                                 POWER USER TIPS
  592.  
  593.        ---------------------------------------------------------------- 
  594.  
  595.        The LOADHIGH statement, used in the AUTOEXEC.BAT file, can be 
  596.        abbreviated to LH if you prefer. LOADHIGH works on only 80386 or 
  597.        80486 machines. 
  598.  
  599.        80286 computers can use the DOS=HIGH command. 
  600.  
  601.        If you are not using DOS 5.0 or 6.0 and are interested in upper 
  602.        memory and extended memory management, you can buy commercial 
  603.        and shareware programs to accomplish this without DOS 5.0 or 
  604.        6.0. 
  605.  
  606.        Never try to relocate HIMEM.SYS or EMM.EXE into the UMA using 
  607.        the DEVICEHIGH command! These programs MUST reside in 
  608.        conventional memory! 
  609.  
  610.        Load HIMEM.SYS before EMM386.EXE. 
  611.  
  612.        Always add the ,UMB switch  to the DOS=HIGH command BEFORE you 
  613.        load device drivers and TSR (memory resident programs) into the 
  614.        UMA. 
  615.  
  616.        Don't try to use EMM386.EXE on 8088, 8086 or 80286 computers. 
  617.               
  618.        Always load the device driver required by your own EMS (expanded 
  619.        memory board) and all device drivers that use extended memory 
  620.        BEFORE you load EMM386.EXE and immediately after loading 
  621.        HIMEM.SYS. 
  622.  
  623.        Do NOT try to use EMM386.EXE to simulate EMS (expanded memory) 
  624.        if another expanded memory manager is already present. 
  625.  
  626.        Sometimes a software program may use its own internal memory 
  627.        manager or DOS extender. If a program works fine before you use 
  628.        EMM386.EXE and fails after installing EMM386.EXE, contact the 
  629.        program's manufacturer. You may need an update to your 
  630.        spreadsheet or database package so that it is compatible with 
  631.        EMM386.EXE. 
  632.  
  633.        If you use Windows 3.0 which contains older versions of 
  634.        EMM386.EXE and HIMEM.SYS programs, delete those versions and use 
  635.        the newer versions which come with DOS 5.0 or 6.0. 
  636.  
  637.        When using DOS 5.0 or 6.0 memory management tricks, remember 
  638.        that EMS (expanded memory) managers use a small portion of UMA 
  639.        which resides between 640K and 1 Meg for the EMS page frame. 
  640.        This page frame memory requirement of EMS memory produces a 
  641.        smaller amount of UMA memory for DOS to relocate device drivers 
  642.        and TSR memory resident programs. This if you do not need EMS 
  643.        memory DO NOT load or configure it! 
  644.  
  645.        Tutorial finished. Have you registered PC-Learn to receive your 
  646.        bonus disks? Registration is encouraged. Shareware works on the 
  647.        honor system! Send $25 to Seattle Scientific Photography, 
  648.        Department PCL6, PO Box 1506, Mercer Island, WA 98040. Latest 
  649.        version of PC-Learn and two bonus disks shipped promptly! 
  650.  
  651.  
  652.